eolymp
bolt
Try our new interface for solving problems

Photo

A river flows down the plain along the line \textbf{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 \textbf{(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 \textbf{180} degrees (the photo-film is a line, and trees in front of it are centrally projected onto the film, center is point \textbf{(0, 0)}); then a segment with trees from one river-side only is cut out of the film, and scaled arbitrarily. \InputFile Each line of the input, except the last one, contains the coordinates of the trees (two integers from \textbf{−20000} to \textbf{20000}). The number of the trees doesn't exceed \textbf{10^5}. The last line contains two zeros. \OutputFile The output must contain a single number, being the maximum number of trees on two matching photos of the two river-sides.
Time limit 1 second
Memory limit 64 MiB
Input example #1
-1 1
0 1
2 1
3 1
7 2
3 -2
1 -1
0 -1
0 -5
-4 -2
-3 -1
0 0
Output example #1
4
Author Andrew Rumyantsev
Source Petrozavodsk summer training camp, August 2005