Time limit
1s
Memory limit
128 MB
A geological survey map marks the locations of buried diamonds with bold dots. You can excavate exactly once. The excavation area must be a square whose two diagonals are parallel to the coordinate axes; call this square a D-square. The diagonal length of the D-square is fixed at K. Choose its center so that the D-square contains as many diamonds as possible.
Let the lower-left point of the map be the origin (0, 0). Every diamond is located at integer coordinates. The four vertices of the D-square must also have integer coordinates, and the center where the two diagonals meet must lie on the map or on its boundary. Diamonds on the boundary of the D-square are considered included.
In the figure below, when K=4, the D-square on the left contains 5 diamonds, while the D-square on the right contains 3 diamonds.

Given the geological survey map, write a program that finds a D-square center that maximizes the number of included diamonds, and outputs that number.
The first line contains four integers N, M, T, and K separated by spaces. N is the width of the map, and M is the height of the map (1 <= N, M <= 1,000,000). T is the number of diamonds, and K is the diagonal length of the D-square. T is an integer between 1 and 100 inclusive, and K is an even integer between 2 and 10,000,000 inclusive.
Each of the next T lines contains two integers A and B, the coordinates of one diamond (0 <= A <= N, 0 <= B <= M). All given diamond coordinates are distinct.
On the first line, output two integers X and Y separated by a space: the coordinates of the center of the chosen D-square. On the second line, output the number of diamonds included in that D-square.
If there are multiple correct answers, output any one of them.