F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Monitor

Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 163840/163840 K (Java/Others)
Total Submission(s): 8698    Accepted Submission(s): 2074


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
6 6 3 2 2 4 4 3 3 5 6 5 1 6 2 2 3 2 5 4 1 5 6 5
 

Sample Output
YES NO
 

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
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-20 20:09:24, Gzip enabled