[BOJ 7841] Count Squares

View as PDF

Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 128M

Problem type
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

Given a set of points with integer coordinates $x_i, y_i$, $i = 1 \ldots 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 $x_i$ $y_i$.

출력 형식

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

예제 입력 1

4 0 0 4 3 -3 4 1 7

예제 출력 1

1

예제 입력 2

9
1 1  1 2  1 3  
2 1  2 2  2 3  
3 1  3 2  3 3

예제 출력 2

6

Comments

There are no comments at the moment.