3339.Fox and Meteor Shower

Time Limit: 1s Memory Limit: 256MB

There is a meteor shower on the sky and there are n meteors. The sky can be viewed as a 2D Euclid Plane and the meteor is point on this plane. Fox Ciel looks at the sky. She finds out that the orbit of each meteor is a straight line, and each meteor has a constant velocity. Now Ciel wants to know: what is the maximum number of meteors such that any pair met at the same position at a certain time? Note that the time is not limited and can be also negative. The meteors will never collide when they appear at the same position at the same time.

Input Format(From the terminal/stdin)

Input The first line contains an integer n (1 \le n \le 1000). Each of the next n lines contains six integers: t1,x1,y1,t2,x2,y2 - the description of a meteor's orbit: at time t1, the current meteor is located at the point (x1, y1) and at time t2, the meteor is located at point (x2, y2) (-106 \le t1,x1,y1,t2,x2,y2 \le 106;t1 \neq t2). There will be no two meteors are always in the same position for any time.

Output Format(To the terminal/stdout)

Output Print a single integer - the maximum number of meteors such that any pair met at the same position at a certain time.

Sample Input 1

Copy
2
0 0 1 1 0 2
0 1 0 1 2 0
 \n
 · · · · · \n
 · · · · · \n

Sample Output 1

Copy
2
 \n

Sample Input 2

Copy
3
-1 -1 0 3 3 0
0 2 -1 -1 3 -2
-2 0 -1 6 0 3
 \n
  ·  · · · · \n
 · ·  ·  · ·  \n
  · ·  · · · \n

Sample Output 2

Copy
3
 \n

Sample Input 3

Copy
4
0 0 0 1 0 1
0 0 1 1 1 1
0 1 1 1 1 0
0 1 0 1 0 0
 \n
 · · · · · \n
 · · · · · \n
 · · · · · \n
 · · · · · \n

Sample Output 3

Copy
1
 \n

Sample Input 4

Copy
1
0 0 0 1 0 0
 \n
 · · · · · \n

Sample Output 4

Copy
1
 \n

Hints

In example 1, meteor 1 and 2 meet in t=-1 at (0, 0). 3339_1.png In example 2, meteor 1 and 2 meet in t=1 at (1, 0), meteor 1 and 3 meet in t=0 at (0, 0) and meteor 2 and 3 meet in t=2 at (0, 1). 3339_2.png In example 3, no two meteor meet. 3339_3.png In example 4, there is only 1 meteor, and its velocity is zero. 3339_4.png If your browser doesn't support animation png, please see the gif version here: http://assets.codeforces.com/images/388e/example1.gifhttp://assets.codeforces.com/images/388e/example2.gifhttp://assets.codeforces.com/images/388e/example3.gifhttp://assets.codeforces.com/images/388e/example4.gif

Submit

请先 登录

© 2025 FAQs