Ural State University Problem Set Archive with Online Judge System

English
Russian
Online Judge
About
Submit Problem
Problem Set
Status (online)
Webboard
FAQ
Links
Authors
Register
Update your info
Authors ranklist
Online Contests
Current Contest
      Problems
      Submit
      Status
      Monitor
Scheduled Contests
Archive
Summary Ranklist


Photo
Time Limit: 2.0 second
Memory Limit: 64 000 KB

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 point (0,0) of the film); 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.

Sample Input

Sample input #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

Sample input #2
0 1
1 1
2 1
-3 -1
-2 -2
-1 -3
0 0

Sample Output

Sample output #1
4

Sample output #2
3

Problem Author: Andrew Rumyantsev
Problem Source: Petrozavodsk summer training camp, August 2005.


Print     Statistic     Discuss     Submit

The Team © 2000-2005. All rights reserved.