#P7865. Drone Coverage Verification

    ID: 21050 Type: Default 1000ms 256MiB

Drone Coverage Verification

Drone Coverage Verification

Consider a plaza represented as an \(n \times m\) rectangle. There are \(s\) drones, and each drone's shooting range is also an axis-aligned rectangle. The drone fleet's coverage area is the union of the shooting ranges of all drones.

Furthermore, there are \(L\) important regions (each given as a rectangle). The quality of the arrangement depends on how many important regions are completely covered by the drone fleet's coverage area. For each important region, determine whether it is completely covered by the union of the drones' shooting ranges.

Note: All rectangles are defined by their lower-left and upper-right coordinates. For a rectangle defined by \((x_1, y_1)\) and \((x_2, y_2)\), it covers all unit cells with coordinates \(x\) and \(y\) such that \(x_1 \le x < x_2\) and \(y_1 \le y < y_2\). It is guaranteed that \(x_1 < x_2\) and \(y_1 < y_2\).

inputFormat

The first line contains four integers \(n\), \(m\), \(s\), and \(L\), representing the dimensions of the plaza, the number of drones, and the number of important regions, respectively.

The next \(s\) lines each contain four integers \(x_1\) \(y_1\) \(x_2\) \(y_2\), describing a drone's shooting range.

The following \(L\) lines each contain four integers \(x_1\) \(y_1\) \(x_2\) \(y_2\), describing an important region.

All values are integers. The drone rectangles and query rectangles are within the bounds of the plaza.

outputFormat

For each of the \(L\) important regions, output a separate line containing YES if the region is completely covered by the union of the drones' shooting ranges, or NO otherwise.

sample

5 5 2 3
0 0 3 3
2 2 5 5
0 0 3 3
1 1 4 4
0 3 3 5
YES

YES NO

</p>