Rectangular division
Easy
Execution time limit is 3 seconds
Runtime memory usage limit is 64 megabytes
Given N rectangles with sides, parallel to the coordinate axes. Required to determine how many parts of these rectangles divide the plane (inside the parts should not be a boundary of the rectangle).
Input
The first line contains the number of rectangles N (1 ≤ N ≤ 100). Next N lines, each containing four numbers: x_1, y_1, x_2, y_2 - coordinates of two opposite corners of the rectangle. All coordinates are integers and absolute value does not exceed 10000.
Output
Derive a single number - the number of parts into which the plane.
Examples
Input #1
Answer #1
Submissions 258
Acceptance rate 16%