#K70307. Camera Coverage Check
Camera Coverage Check
Camera Coverage Check
In this problem, you are given a set of cameras, each of which covers a rectangular area on a 2D plane. The rectangle is defined by its top-left and bottom-right coordinates. Your task is to check whether a given point ( (x, y) ) lies in the field of view of at least one camera. A point lying on the boundary of a rectangle is considered to be covered.
Formally, for a rectangle with top-left ( (x_1,y_1) ) and bottom-right ( (x_2,y_2) ), a point ( (x, y) ) is covered if and only if ( x_1 \leq x \leq x_2 ) and ( y_1 \leq y \leq y_2 ).
inputFormat
The input is read from standard input (stdin) with the following format:
n x1 y1 x2 y2 x1 y1 x2 y2 ... (n lines in total) x y
Here, n
is the number of cameras. Each of the next n
lines contains four integers representing the top-left \( (x_1, y_1) \) and bottom-right \( (x_2, y_2) \) coordinates of a camera's view. The last line contains two integers which represent the coordinates of the point to be checked.
outputFormat
The output should be written to standard output (stdout) as a single line containing either Covered
if the point lies inside (or on the boundary of) at least one camera's view, or Uncovered
otherwise.
3
1 3 5 5
2 4 6 7
0 0 3 2
4 4
Covered