• 2338 正方形计数

    Time Limit : 10000/5000 MS(Java/Others) | Memory Limit : 131072/65536 KB(Java/Others)

    Submits : 5 | Solved : 0

    Description

    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

    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

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

    Sample Input

    4
    1 0
    0 1
    1 1
    0 0
    4
    -2 5
    3 7
    0 0
    5 2

    Sample Output

    1
    1
    

    HINT


    Source


    [ Top ] | [ Submit ] | [ Statistics ] | [ Standing ]