Loading [MathJax]/jax/output/CommonHTML/jax.js

Problem F. Fence relicts

Author:A. Klenin   Time limit:2 sec
Input file:input.txt   Memory limit:64 Mb
Output file:output.txt  

Statement

The Nearsea region has a large forest, where many relict trees grow. The local government decided to create a reservation park with the area between 0 and S square meters. The park must have a shape of rectangle with the sides parallel to coordinate axises.

Environment activists surveyed the forest and found out that it contained N relict trees located at coordinates (xi,yi), measured in meters.

Find such park location and size that the number of relict trees inside of it or on its boundary is maximum possible.

Input file format

Input file contains integers NS followed by N pairs of integers xiyi.

Output file format

Output file must contain integers xayaxbyb — coordinates of the two opposite corners of the park. If there is more than one optimal solution, output any of them.

Constraints

1N500, 104xi,yi104, 1S109

Sample tests

No. Input file (input.txt) Output file (output.txt)
1
5 100
0 0  10 0  10 10  0 10  15 10
0 0 10 10
2
3 2
0 0  10 0  20 0
0 0 20 0

0.036s 0.006s 13