![]() |
||||||||||
|
||||||||||
MonitorTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 163840/163840 K (Java/Others)Total Submission(s): 9483 Accepted Submission(s): 2199 Problem Description Xiaoteng has a large area of land for growing crops, and the land can be seen as a rectangle of $n \times m$. But recently Xiaoteng found that his crops were often stolen by a group of people, so he decided to install some monitors to find all the people and then negotiate with them. However, Xiao Teng bought bad monitors, each monitor can only monitor the crops inside a rectangle. There are $p$ monitors installed by Xiaoteng, and the rectangle monitored by each monitor is known. Xiao Teng guess that the thieves would also steal $q$ times of crops. he also guessed the range they were going to steal, which was also a rectangle. Xiao Teng wants to know if his monitors can see all the thieves at a time. Input There are mutiple test cases. Each case starts with a line containing two integers $n,m (1 \leq n,1 \leq m , n \times m \leq 10^7)$ which represent the area of the land. And the secend line contain a integer $p(1 \leq p \leq 10^6)$ which represent the number of the monitor Xiaoteng has installed. This is followed by p lines each describing a rectangle. Each of these lines contains four intergers $x_1,y_1,x_2~and~y_2(1\leq x_1 \leq x_2 \leq n,1\leq y_1 \leq y_2 \leq m)$ ,meaning the lower left corner and upper right corner of the rectangle. Next line contain a integer $q(1 \leq q\leq 10^6)$ which represent the number of times that thieves will steal the crops.This is followed by q lines each describing a rectangle. Each of these lines contains four intergers $x_1,y_1,x_2~and~y_2(1\leq x_1 \leq x_2 \leq n,1\leq y_1 \leq y_2 \leq m)$,meaning the lower left corner and upper right corner of the rectangle. Output For each case you should print $q$ lines. Each line containing YES or NO mean the all thieves whether can be seen. Sample Input
Sample Output
Hint In the picture,the red solid rectangles mean the monitor Xiaoteng installed, and the blue dotted rectangles mean the area will be stolen. ![]() Source | ||||||||||
|