Inspecting Radars 

Radars Inc. is a worldwide renowned radar maker, whose excellent reputation lies on strict quality assurance procedures and a large variety of radar models that fit all budgets. The company hired you to develop a detailed inspection that consists of a sequence of E experiments on a specific surveillance model.


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 $ \alpha$, A, h, and H, whose meaning is illustrated with the following figure:

\epsfbox{p12323.eps}

Formally, the scan area of the model is the region described by the set of polar points

{(r,$\displaystyle \theta$)| h $\displaystyle \leq$ r < h + H$\displaystyle \alpha$ $\displaystyle \leq$ $\displaystyle \theta$ $\displaystyle \leq$ $\displaystyle \alpha$ + A}

$ \alpha$, A, h and H are four integer values where:

An object placed at (r,$ \theta$) will be displayed by the model if h $ \leq$ r < h + H and $ \alpha$ $ \leq$ $ \theta$ $ \leq$ $ \alpha$ + 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 $ \alpha$ ( 0 $ \leq$ $ \alpha$ < 360) and h ( 0 $ \leq$ h < R) are free to set (as integer numbers), and the parameters H ( 1 $ \leq$ H $ \leq$ R) and A ( 0 $ \leq$ A < 360) are given.

Input 

The input consists of several test cases. Each test case is described as follows:

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.

Output 

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 $ \leq$ j $ \leq$ E).

Sample Input 

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

Sample Output 

1
6
9
5
3
3
2
2