There are N points on the Cartesian coordinate system. Now we have to find how many rectangles we can draw with those N points. Notice that we only need to find the rectangles whose 4 edges are parallel with the X and Y axes.
For example, we can draw 3 rectangles in the following figure.

The first line is the number T (1<=T<=15), meaning that there are T times of operation.
The second line is N, meaning that there are N points for every operation.
For the next N lines, each line contains two numbers, x and y, meaning that the position of the point is (x, y). Besides, there won't be two points on the same position.
For every operation, please output the max number of rectangles we can draw.
### Hint1:
Implement two loops to find the left-top and the right-bottom points of each possible rectangle, and use these two points for judging.
### Hint2: