P13162 [HackerEarth] sunny arpit and kunal
普及
题目描述

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

SAMPLE INPUT
2
1 3 4
0 3 5

SAMPLE OUTPUT
1
2

输入格式

见题面

输出格式

见题面

样例输入
2 1 3 4 0 3 5 SAMPLE
样例输出
1 2