测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A9297. Fox and Meteor Shower

编程题 普及/提高-

题目描述

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.

输入格式

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.

输出格式

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

输入输出样例

输入 #1
2
0 0 1 1 0 2
0 1 0 1 2 0
输出 #1
2
输入 #2
3
-1 -1 0 3 3 0
0 2 -1 -1 3 -2
-2 0 -1 6 0 3
输出 #2
3
输入 #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
输出 #3
1
输入 #4
1
0 0 0 1 0 0
输出 #4
1

说明/提示

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

![](/uploads/acgo/image/2effad9994c795f2_cf17baba1494.jpeg)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).

![](/uploads/acgo/image/cca39f1a2fa9d3b9_0107a43ecf47.jpeg)In example 3, no two meteor meet.

![](/uploads/acgo/image/57ec023eef5ddf0a_dd4959526fb6.jpeg)In example 4, there is only 1 meteor, and its velocity is zero.

![](/uploads/acgo/image/f65b7fa9830d1ce7_7b005fdaf735.jpeg)If your browser doesn't support animation png, please see the gif version here:

http://assets.codeforces.com/images/388e/example1.gif

http://assets.codeforces.com/images/388e/example2.gif

http://assets.codeforces.com/images/388e/example3.gif

http://assets.codeforces.com/images/388e/example4.gif
上一题 去做题 下一题