2011年12月17日 星期六

11227 - The silver bullet.

給定一群牛羚的位置,請你找出位在同一直線上的牛羚最多有幾隻。

Input

輸入資料的第一列有一整數T(1 <= T <= 10)表示測試資料的組數,每組資料的第一列有一整數N(1 <= N <= 100)表示牛羚的數量,接下來有N列,每列有兩個實數(X, Y)表示每隻牛羚的位置(X, Y的值最多精確到小數點後兩位),且100.00 >= X, Y >= -100.00。位置重複的牛羚只能計算一次。

Output

請參考範列資料的格式輸出資料編號、牛羚的總數、最多能連成一線的牛羚總數。

Sample input

3
5
0.00 0.00
0.00 0.00
1.00 1.00
1.00 0.00
0.00 1.00
2
0.00 0.00
0.00 0.00
6
0.00 2.00
0.00 0.00
1.00 1.00
1.00 0.00
0.00 1.00
0.00 -2.00

Sample output

Data set #1 contains 4 gnus, out of which a maximum of 2 are aligned.
Data set #2 contains a single gnu.
Data set #3 contains 6 gnus, out of which a maximum of 4 are aligned.

原文出處

沒有留言:

張貼留言