597 - 103學年TPC中階班作業題目 Scoreboard

Time

2014/09/15 00:00:00 2015/01/01 00:00:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

1613 - Problem D. Daily Walk   

Description

Welcome to Summer Rift! Summer Rift is a modern city. Its roads run either north-south or east-west and therefore the whole city looks like a grid table. As a result, every intersection in Summer Rift can be identified by a pair of integer (x, y), 0<=x<=n, 0<=y<=m.
Garen is a Summer Rift citizen and lives at intersection (0, 0). Every day he is going to visit Lux, who is living at intersection (n, m), and fight with her. Garen don't want to waste time, so he needs to follow a shortest route from (0, 0) to (n, m). In other words, if Garen is at intersection (x, y) on his way to Lux's place, he can only go to (x+1, y) or (x, y +1) in the next step. Now Garen wonders that how many routes he can choose.
Oh, that's too easy, right?
Summer Rift is also a dangerous city. There're many rampage enemies that slay, double-kill or triple-kill other citizens. So every day the police will block a rectangle region which is represented as (x1, y1, x2, y2). All intersections (x, y) that satisfy x1<=x <=x2 and y1<=y<=y2 are dangerous this day.
Every day Garen receives the blocked region (x1, y1, x2, y2) of that day before he visits Lux. Now Garen wonders how many routes he can choose to visit Lux without passing through any dangerous intersection during the tour?

Input

The first line of input contains an integer T, the number of test cases in total.
The first line of each test case contains three integers n; m; d, the size of Summer Rift and the number of considered days. Each of following d lines contains four integers (x1, y1, x2, y2) which is the representation of the blocked region of that day.
1<=T<=25
1<=n,m<=2000
1<=d<=2*10^5
0<=x1<=x2<=n, 0<=y1<=y2<=m

Output

Print the number of routes module 10007 for each day, one day per line.

Sample Input  Download

Sample Output  Download

Tags




Discuss




10019 - Lining Up   

10021 - Wavio Sequence   

10055 - Playing with Wheels   

10056 - Buy Tickets   

Description

 poj:

http://poj.org/problem?id=2828

 

 

Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss




10057 - Frequent values   

Description

 uva:

http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=2176

 

Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss




10059 - Sliding Window   

Description

poj:

http://poj.org/problem?id=2823

Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss




10078 - A Simple Problem with Integers   

Description

poj:

http://poj.org/problem?id=3468

 

Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss




10079 - Summits   

10080 - Maximum Sum   

10081 - Assembly line   

10082 - Image Is Everything   

10083 - Meteor   

10118 - Steam Roller   

10119 - Palindromic Subsequence   

Description

uva 11404  Palindromic Subsequence:

http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=2399



Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss




10120 - Jurassic Remains   

10121 - Roads in the North   

10122 - Corporative Network   

10123 - Paper Folding   

10155 - The Largest Clique   

Description

 uva 11324  The Largest Clique

http://uva.onlinejudge.org/index.php?option=onlinejudge&Itemid=8&page=show_problem&problem=2299


 

Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss




10156 - 9 Puzzle   

10157 - Interstellar Trade   

10187 - Moving to Nuremberg   

10188 - Game of Sum   

10189 - Fabled Rooks   

Description

 uva 11134 Fabled Rooks

http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=2075

Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss




10190 - Bishops   

10214 - Long Distance Taxi   

10215 - String painter   

10216 - Asterix and Obelix   

10217 - Parade   

10247 - Piece it together   

Description

uva 1514 Piece it together:

http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=4260


pdf:

http://uva.onlinejudge.org/external/15/1514.pdf
 

Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss




10248 - And Then There Was One   

10249 - Surrounding a house   

10278 - Plants vs. Zombies HD SP   

Description

uva 12452 Plants vs. Zombies HD SP

http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=3883



Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss




10279 - Period   

10280 - Number Assignment