Leo and Rio were playing a game one day . below is the description of game.
There are n lights on a plane, the i-th light is located at point (Xi, Yi).
They need to arrange a plan, but there are some difficulties on their way. As you know, Leo considers the distance between point i and j to be Manhattan distance whereas Rio, as an ordinary person, calculates the distance using the formula .
The success of the game relies on the number of pairs (i, j) (1 <= i < j<= n), such that the distance between point i and point j calculated by Leo and Rio is equal. You were asked to compute the number of such pairs.
Manhattan distance between point i and j is:-|Xi-Xj|+|Yi-Yj|.
INPUT
First line consist of T - number of test cases.
First line of each test case consist of N - number of points . Each of the following N lines contains two integers Xi and Yi .
OUTPUT
Print the number of pairs of points such that the distance between them calculated by Leo is equal to the distance calculated by Rio.
Constraints:- T<=10 , N<=200,000 , ((|Xi|,|Yi|)<=10^9).
Example
INPUT
3
1 1
7 5
1 5
OUTPUT
2
Problem author:- Mohit jain