favorite We need a little bit of your help to keep things running, click on this banner to learn more

Rectangles and nails

Rectangles and nails

On the coordinate plane given N rectangles - kozhdy pair of opposite vertices, sides are parallel to coordinate axes and coordinates of the vertices - integers from the interval [-50, 50]. What is the maximal number of rectangles can be nailed to the plane of a single nail? Rectangle is considered to be nailed, if a nail hammered into the inner point of the rectangle.


The first line contains one number N. Further, there are N rows of 4 numbers - the coordinates of one of the diagonals of the rectangle.


One number - the largest number of rectangles that can be nailed one nail.

Time limit 1 second
Memory limit 64 MiB
Input example #1
-9 -11 -13 12
3 -3 -10 9
13 9 -12 10
9 6 -10 -8
Output example #1