Ensure that you are logged in and have the required permissions to access the test.
You are given a 2D plane containing N distinct integral points in the form of (X,Y). Now a line segment is drawn between each pair of points. Your task is to determine the number of unordered pairs of these line segments that are orthogonal to each other.
Input format
Output format
Print a single integer that represents the number of quadruples as described in the problem statement
Constraints
1≤N≤2∗103
−2∗103≤X,Y≤2∗103
Subtasks
Let the points be labelled P1,P2,P3,P4,P5 respectively according to the order in the sample input. One of the possible quadruple is P2,P3,P4,P5 because the angle between the line segments P2,P3 and P4,P5 is 90o. There are 9 more such quadruples. Hence the answer to this sample case is 10.