Pro.ID22695 TitleMax's point Title链接http://10.20.2.8/oj/exercise/problem?problem_id=22695 AC0 Submit0 Ratio- 时间&空间限制描述Given a set of points, say P, in two dimension. Define the subset of P, say S, as follows: For any three points, say i, j, k, of S, it holds that: dis(i, j) = dis(j, k) = dis(i, k) ( here dis(i, j) means the distance between point i and j ) It is your task to find the number of S which just contains 3 points in it. 输入Input contains multiple test data sets. For each data set, first comes one integer n ( 1 ≤ n ≤ 1000000 ), the number of the points. Then n lines follow, each has two integer numbers x, y ( |x| < 1.5*109, |y| < 1.5*109 ), the coordinates of that point. The points may be overlaped, but they are regarded as different points. Refer to Sample Input for details. Input is terminated by EOF. 输出Description Given a set of points, say P, in two dimension. Define the subset of P, say S, as follows: For any three points, say i, j, k, of S, it holds that: dis(i, j) = dis(j, k) = dis(i, k) ( here dis(i, j) means the distance between point i and j ) It is your task to find the number of S which just contains 3 points in it. Input Input contains multiple test data sets. For each data set, first comes one integer n ( 1 ≤ n ≤ 1000000 ), the number of the points. Then n lines follow, each has two integer numbers x, y ( |x| < 1.5*109, |y| < 1.5*109 ), the coordinates of that point. The points may be overlaped, but they are regarded as different points. Refer to Sample Input for details. Input is terminated by EOF. Output For each test data set, one output data set should be generated as follow: Output one integer per line presenting the number of subsets S satisfying the conditions described above. Sample Input 3 Sample Output 1 Source 样例输入3 样例输出1 作者 |