Given n points on the plane, determine the maxmimum number of points lying on a single line. That is, the line could be arbitrarily chosen, and you are to find the largest possible number of points a line could cross simultaneously.
You can assume there are no two points with same coordinates.
There are multiple testcase, input is terminated by EOF.
Each testcase starts with an integer N (1<=N<=1000), and the following N lines each contain a pair of integer that represents the coordinate of a point. 0 <= |xi|, |yi| <= 1000000.
For each testcase output an integer on a single line, indicating the maximumm number of points a single straight line could cross.
8 2 3 4 7 1 6 5 9 2 2 0 -3 6 11 -2 -5
5
Migrated from old NTUJ.
uva270
No. | Testdata Range | Score |
---|