Parallelogram Counting

No attempts yetTime limit1sMemory limit128 MB

Problem

You are given $n$ distinct points in the plane, each with integer coordinates. Count the number of parallelograms whose four vertices are all among these points.

Formally, count the $4$-element subsets that can be labeled ${A, B, C, D}$ so that $AB \parallel CD$ and $BC \parallel AD$. No four of the given points are collinear.

Input

The first line contains an integer $t$ ($1 \le t \le 10$), the number of test cases. The test cases follow.

For each test case, the first line contains an integer $n$ ($1 \le n \le 1000$). Each of the next $n$ lines contains two space-separated integers $x$ and $y$ ($|x|, |y| \le 10^9$), the coordinates of one point.

Output

Print $t$ lines. The $i$-th line contains the number of parallelograms for the $i$-th test case.