Sandeep Bhaiya has a wish which we want to be fulfilled, can you help him? Each data in the Rajendra Nagar has 2 integer variables. In total Rajendra Nagar has n such datas. Sandeep Bhaiya wants to calculate for each of the data how much data's are there which are strictly smaller then this data.
Definition of a data being smaller than other is as follows ,
data 1 is smaller then data 2 if sum of two integers in data 1 is less than that of data 2.
If sum of both are equal then one with the small value of first integer is smaller.
With this definition you have the smaller one among the two , so obviously the other one is larger.
Note :- The data in rajendra nagar follows the property that no two data are exactly same, that is , no two will have same value of both the integers.
Input:-
first line has no.of test cases.
Each test case has , n the no, of datas , then n following lines have 2 integers representing the first and the second integer of the data respectively.
summation of n over all test case <= 500000
0<= Value of integer data <=1e9
Output:-
For each test case , output one line having n integers, representing how many datas are smaller then this data.
Ideal solution is attached so you can have answer for any test case you want.