There are \(n\) points in the plane, the \(i^{th}\) of which is labeled \(A_i\) and has coordinates \((x_i, y_i)\). How many ordered quadruples of pairwise-distinct indices \((p,q,r,s)\) are there such that \(A_p A_q + A_r A_s = A_q A_r + A_p A_s\)?
Input Format :
The first line of input contains a single integer \(n\).
The next \(n\) lines of input each contain two space-separated integers \(x_i\) and \(y_i\).
Output Format :
Print a single integer: the number of ordered quadruples satisfying the above condition.
Constraints :
\(4 \le n \le 250\)
\(0 \le x_i, y_i \le 16\)
Note :
\(A_i A_j\) is the euclidean distance between points \(A_i\) and \(A_j\).
The eight quadruples are:
- \((0,1,3,2)\)
- \((0,2,3,1)\)
- \((1,0,2,3)\)
- \((1,3,2,0)\)
- \((2,0,1,3)\)
- \((2,3,1,0)\)
- \((3,1,0,2)\)
- \((3,2,0,1)\)
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor