Problem G
Intersecting Rectangles
You are given a set of
![\includegraphics[width=1.0\textwidth ]{rectangles.jpg}](/problems/intersectingrectangles/file/statement/en/img-0001.jpg)
In this example, only rectangles A and B intersect.
Input
Each test case will begin with a line with a single integer
Each of the next
(
Output
Output a single integer, which is
Sample Input 1 | Sample Output 1 |
---|---|
3 0 0 2 2 1 1 3 4 5 7 6 8 |
1 |
Sample Input 2 | Sample Output 2 |
---|---|
4 0 0 20 20 1 1 3 4 2 10 9 12 11 3 19 18 |
0 |