Codeforces Round 228 (Div. 1)
E
Fox and Meteor Shower
Codeforces
3100
原题
← D→
翻译中…

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

翻译中…

The first line contains an integer $*n*$ ($1 ≤ *n* ≤ 1000$). Each of the next $*n*$ lines contains six integers: $*t*_{1}, *x*_{1}, *y*_{1}, *t*_{2}, *x*_{2}, *y*_{2}$ — the description of a meteor's orbit: at time $*t*_{1}$, the current meteor is located at the point ($*x*_{1}$, $*y*_{1}$) and at time $*t*_{2}$, the meteor is located at point ($*x*_{2}$, $*y*_{2}$) ($- 10^{6} ≤ *t*_{1}, *x*_{1}, *y*_{1}, *t*_{2}, *x*_{2}, *y*_{2} ≤ 10^{6}; *t*_{1} ≠ *t*_{2}$).

翻译中…

There will be no two meteors are always in the same position for any time.

翻译中…

Output

翻译中…

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

翻译中…

Note

翻译中…

In example 1, meteor 1 and 2 meet in $*t*$=-1 at (0, 0).

翻译中…

image

翻译中…

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).

翻译中…

image

翻译中…

In example 3, no two meteor meet.

翻译中…

image

翻译中…

In example 4, there is only 1 meteor, and its velocity is zero.

翻译中…

image

翻译中…

If your browser doesn't support animation png, please see the gif version here:

翻译中…

样例

Input #1
2
0 0 1 1 0 2
0 1 0 1 2 0
Output #1
2
InputCopy OutputCopy
Input #2
3
-1 -1 0 3 3 0
0 2 -1 -1 3 -2
-2 0 -1 6 0 3
Output #2
3
InputCopy OutputCopy
Input #3
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
Output #3
1
InputCopy OutputCopy
Input #4
1
0 0 0 1 0 0
Output #4
1
InputCopy OutputCopy
题目信息
题号
388E
时间限制
6 s
内存限制
256 MB
标签
计算几何

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。