Is it just a fad or is it here to stay? You're not sure, but the steadily increasing number of tea shops that are launching in your native has become quite a draw. Probably, people have become so attached to tea that flats next to several tea shops will yield higher rents. This has come to the consideration of a local real estate company. They are involved in identifying the most valuable areas in the city in terms of their proximity to huge numbers of tea shops. They have offered you a sketch of the city, pointed with the areas of tea shops. Considering that the average person is willing to walk only a certain number of blocks for their morning tea, you have to find the area from which one can arrive at the largest number of tea shops. As you are probably aware, your native is based on a square grid layout, with blocks aligned on north-south and east-west axes. Since you have to walk along streets, the distance between intersections (p, q) and (r, s) is |p - r| + |q - s|
Input format:
The input describes a city. The first line of the input contains four integers d X ^ r d_{y} n, and q. These are the dimensions of the city grid d_{x}*d_{y} the number of tea shops n, and the number of queries q. Each of the next n lines contains two integers x_{i} and y ij these specify the location of the ith tea shop. There will be at most one tea shop per intersection. Each of the next q lines contains a single integer m, the maximal distance that a person is willing to walk for a cup of tea.
OUTPUT FORMAT:
Display one line per query. Each line displays the maximum number of tea shops reachable for the given query distance m followed by the optimal location. For example, the sample output shows that 3 tea shops are within query distance 1 of the optimal location (3, 4), 4 shops are within query distance 2 of optimal location (2, 2), and 5 shops are within query distance 4 of optimal location (3, 1). If there are multiple optimal locations, pick the location that is the furthest south (minimal positive integer y-coordinate). If there is still a tie, pick the location furthest west (minimal positive integer x-coordinate).
Code constraints:
1 <= d_{x}*d_{y} <= 1000
0 <= n <= 5.1 ^ 5
1 <= q <= 20
1 <= x_{i}sd_{x}
1 <= y_{i} <= d_{y}
0 <= m <= 10 ^ 6
simple test cases:
input 1: output 1:
4 4 5 3 3(3,4)
1 1 4(2,2)
1 2 5(3,1)
3 3
4 4
2 4
1
2
4
Code Size: 1024 kb