#P1142. Straight Flight Bombing
Straight Flight Bombing
Straight Flight Bombing
Pilot klux is in trouble! He needs to perform a single bombing run with his damaged airplane, which can only fly in a straight line without turning. His goal is to bomb as many target locations as possible. The targets are given as points on a plane, and klux must choose a straight path that passes through the maximum number of these points.
Given a set of points, determine the maximum number of points that lie on the same straight line.
Note: Some points might be duplicate. Be sure to handle duplicates correctly.
inputFormat
The first line contains a single integer n (1 ≤ n ≤ 1000) representing the number of target points. Each of the following n lines contains two space-separated integers x and y (-104 ≤ x, y ≤ 104) specifying the coordinates of a target point.
outputFormat
Output a single integer representing the maximum number of points that lie on a single straight line.
sample
6
1 1
2 2
3 3
4 1
5 1
6 1
3