| Inspecting Radars | 
There is a field represented with a polar coordinate plane that contains N objects placed at positions with integer 
polar coordinates. The inspected model is located at the origin (0, 0) of the field and can detect objects at a distance less than 
its detection range R through a scan area defined by four adjustment parameters  , A, h, and H, whose 
meaning is illustrated with the following figure:
, A, h, and H, whose 
meaning is illustrated with the following figure:
 
Formally, the scan area of the model is the region described by the set of polar points
 )| h
)| h  r < h + H,
 r < h + H,  
  
  
  
  + A}
 + A}
 , A, h and H are four integer values where:
, A, h and H are four integer values where:
 specifies the start angle of the radar's scan area (
0
 specifies the start angle of the radar's scan area (
0  
  < 360);
 < 360);
 A < 360);
 A < 360);
 h < R); and
 h < R); and
 H
 H  R).
 R).
An object placed at 
(r, ) will be displayed by the model if 
h
) will be displayed by the model if 
h  r < h + H and
 r < h + H and 
 
  
  
  
  + A, where the last inequality should be understood modulo 360o (i.e., adding and 
comparing angles in a circle).
 + A, where the last inequality should be understood modulo 360o (i.e., adding and 
comparing angles in a circle).
Given N objects placed on the field, you must develop an inspection of the surveillance model through the implementation 
of E experiments with specific parameterizations. For each experiment you have to find the maximal number of objects on the field 
that the radar should display if the parameters  (
0
 (
0  
  < 360) and h (
0
 < 360) and h (
0  h < R) are free to set 
(as integer numbers), and the parameters H (
1
 h < R) are free to set 
(as integer numbers), and the parameters H (
1  H
 H  R) and A (
0
 R) and A (
0  A < 360) are given.
 A < 360) are given.
The input consists of several test cases. Each test case is described as follows:
 N
 N  104, 
2
 104, 
2  R
 R  102).
 102).
 separated by blanks, specifying the 
integer polar coordinates 
(ri,
 separated by blanks, specifying the 
integer polar coordinates 
(ri, ) of the i-th object (
1
) of the i-th object (
1  ri < R, 
0
 ri < R, 
0  
  < 360, 
1
 < 360, 
1  i
 i  N).
 N).
 E
 E  102).
 102).
 Hj
 Hj  R, 
0
 R, 
0  Aj < 360, 
1
 Aj < 360, 
1  j
 j  E).
 E).
For each test case you can suppose that there are not two different objects placed at the same integer polar coordinate. The last test case is followed by a line containing two zeros.
For each test case of the input, print E lines where the j-th line contains the maximal number of objects on the 
field that the radar should display according to the parameterization given for the j-th experiment (
1  j
 j  E).
 E).
6 100 15 7 15 60 40 15 50 15 45 30 45 90 2 2 1 100 359 9 100 15 7 15 60 40 15 50 15 45 30 45 90 40 45 50 45 78 100 6 100 359 11 30 10 30 11 29 5 30 11 10 0 0
1 6 9 5 3 3 2 2