Sherlock is given a 1D array containing characteristics of $$N$$ robots on his birthday by Watson. Each robot has two special properties- Humour and Intelligence. For every robot, Sherlock has to calculate Personality Index. It is calculated as-
For every robot, print it's Personality Index in a new line.
for i=1 to i=n for j=i to j=n if(Humour[i]<=Humour[j]) PersonalityIndex[i]+=(Intelligence[i]-Intelligence[j]); else PersonalityIndex[i]+=(Intelligence[j]-Intelligence[i]);
The first line contains $$N$$, the number of robots. Each of the next $$N$$ lines contains two integers- Humour and Intelligence.
Output the Personality Index of every robot in a new line.