A river flows down the plain along the line y = 0. There are trees growing in the plain to the both sides of the river, but not on the river itself. A dam is positioned on the river in the point (0,0). It is necessary to make two matching photos of the two river-sides
from the dam. The photos are considered matching if the arrangement of the trees on them match (only the horizontal arrangement is considered, not the distance to the trees).
If a tree is obscured with another one, the tree isn't present in the photo. No two trees occupy one point. Sizes of the photo-camera and the trees are negligible.
The photographing occurs in the following way: first a camera is used whose spanning angle is arbitrary close to 180 degrees (the photo-film
is a line, and trees in front of it are centrally projected onto the film, center is point (0,0)); then a segment with trees from one river-side only is cut out of the film, and scaled arbitrarily.
Input
Each line of the input, except the last one, contains the coordinates of the trees (two integers from −20000 to 20000). The number of the trees doesn't exceed 105.
The last line contains two zeros.
Output
The output must contain a single number, being the maximum number of trees on two matching photos of the two river-sides.
Samples
input | output |
---|
-1 1
0 1
2 1
3 1
7 2
3 -2
1 -1
0 -1
0 -5
-4 -2
-3 -1
0 0
| 4
|
0 1
1 1
2 1
-3 -1
-2 -2
-1 -3
0 0
| 3
|
Problem Author: Andrew Rumyantsev
Problem Source: Petrozavodsk summer training camp, August 2005.