Sunny, Arpit and Kunal are playing a game. All three of them are standing on a number line, each occupying a different integer.
The rules are as follows:
Two of them cannot be at the same integer at same time.
In one move, one of them, who is not between the other two, can jump to a integer ( if there is any space ) between the other two.
If no one can make a move, the game is over.
Now, they want to play as long as possible. Help them in this.
Input:
First line contains and integer T, the number of testcases. Next T lines contain three numbers, A, B and C, each denoting the intial positions of three of them.
Output:
For each testcase, output the maximum number of moves that can be made by three of them, if they play optimally.
Constraints:
1 <= T <= 1000 0 <= A,B,C < = 1000