Given a set of points, every pair of points can determine a line. In principle, we can generate N(N-1)/2 lines when there are N points(N < 100). However, it is possible that not all the lines are unique. For example, the three points (0,0), (1,1) and (2,2) give only one unique line. Given a set of points, the task here is to determine the number of unique lines.
The first line is the number of test cases. Each subsequent line is a test case and contains a series of numbers. The first number is the number of points. Each subsequent pair of numbers is the x and y coordinates of a point. You can assume that all the numbers are integers and all the points in a test case are distinct.
For each test case, determine and print out the number of unique lines in a separate line.
範例輸入 1
2 7 0 0 1 1 2 2 3 3 4 4 6 6 0 3 5 0 0 1 1 1 -1 -1 1 -1 -1
範例輸出 1
7 6
Pro 專屬功能: 查看這題在歷屆 CPE 出現過幾次 — 升級以解鎖.