1707: Count Squars

内存限制:128 MB 时间限制:5.000 S
评测方式:文本比较 命题人:
提交:0 解决: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. -10^4 ≤ xi, yi ≤ 10^4, 1 ≤ N ≤ 2000. All points in the input are different.

输出

One integer that the the number of squars.One line per case.

样例输入 复制

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

样例输出 复制

1
6

来源/分类