2060 Count Squares

时间限制 : 6000/3000 MS(Java/Others) | 内存限制 : 131072/65536 KB(Java/Others)

Submits : 6 | Solved : 0

题目描述

Given a set of points with integer coordinates xi, yi, i = 1...N, your program must find all the squares having each of four vertices in one of these points.

输入要求

Input file contains integer N followed by N pairs of integers xi yi.
Constraints
-10^4 ≤ xi, yi ≤ 10^4, 1 ≤ N ≤ 2000. All points in the input are different.

输出要求

Output file must contain a single integer ― number of squares found.

输入样例

Sample input 1
4
0 0 4 3 -3 4 1 7
Sample input 2
9
1 1  1 2  1 3
2 1  2 2  2 3
3 1  3 2  3 3

输出样例

Sample output 1
1
Sample output 2
6

提示

Bold texts appearing in the sample sections are informative and do not form part of the actual data.

来源

Northeastern Europe 2005, Far-Eastern Subregion

[ 返回顶端 ] | [ 代码提交 ]