PROGRAMMING:No Breakfast for College Students
As we all know, there is no breakfast for college students. And during Little Gyro's vacation, this kind of situation seems to be especially common.
It contains three meals in one day. Every day there includes breakfast, lunch and supper(Of course, always in this order) prepared by Little Gyro's parents Mr./Mrs. Potato. But Little Gyro sometimes missed some of them. The only thing that Little Gyro could remember till now is how many times he had breakfast, lunch and supper, which Mrs. Potato told him.
Little Gyro couldn't exactly remember the time when he went back home(before breakfast, before lunch, before supper or after supper), and the time when he went to school(before breakfast, before lunch, before supper or after supper). So he considers any of these options. After Little Gyro went back home, he was at home all the time until he went to school.
Please note, it's possible that Little Gyro might have left home on the same day he arrived.
According to Little Gyro's mother Mrs. Potato told him, you are asked to help Little Gyro find the minimum number of meals he might forget. You shouldn't count the missed meals on the arrival day before Little Gyro's arrival and the departure day after he left home.
### Input Specification:
There are multiple test cases. The first line of the input contains an integer $$T$$ (1 ≤ $$T$$ ≤ 1000), indicating the number of test cases. For each test case:
Each line contains three integers $$b$$, $$l$$ and $$s$$ (0 ≤ $$b,d,s$$ ≤ $$10^{18}$$), indicating the number of breakfast, lunch and supper which Little Gyro had taken during his vacation.
### Output Specification:
For each case, output the minimum number of the meals which Little Gyro might forget during his vacation.
### Sample Input:
```in
two
3 2 1
1 1 1
```
### Sample Output:
```out
one
0
```
answer:If there is no answer, please comment
First of all, we need to know that we can reduce one or two meals on the determination of arrival time and departure time, and then we know that in addition to arrival and departure, we need to complete three meals every day, which means that in a complete case, the difference between the three numbers should not be greater than 1. And because three meals can be seen as a ring, breakfast and lunch are adjacent, lunch and dinner are adjacent, and dinner is adjacent to the next day's breakfast, so we only need to find the maximum of the three numbers, and then complete the other two numbers to a value greater than or equal to the maximum minus one to form a complete three meals.
It contains three meals in one day. Every day there includes breakfast, lunch and supper(Of course, always in this order) prepared by Little Gyro's parents Mr./Mrs. Potato. But Little Gyro sometimes missed some of them. The only thing that Little Gyro could remember till now is how many times he had breakfast, lunch and supper, which Mrs. Potato told him.
Little Gyro couldn't exactly remember the time when he went back home(before breakfast, before lunch, before supper or after supper), and the time when he went to school(before breakfast, before lunch, before supper or after supper). So he considers any of these options. After Little Gyro went back home, he was at home all the time until he went to school.
Please note, it's possible that Little Gyro might have left home on the same day he arrived.
According to Little Gyro's mother Mrs. Potato told him, you are asked to help Little Gyro find the minimum number of meals he might forget. You shouldn't count the missed meals on the arrival day before Little Gyro's arrival and the departure day after he left home.
### Input Specification:
There are multiple test cases. The first line of the input contains an integer $$T$$ (1 ≤ $$T$$ ≤ 1000), indicating the number of test cases. For each test case:
Each line contains three integers $$b$$, $$l$$ and $$s$$ (0 ≤ $$b,d,s$$ ≤ $$10^{18}$$), indicating the number of breakfast, lunch and supper which Little Gyro had taken during his vacation.
### Output Specification:
For each case, output the minimum number of the meals which Little Gyro might forget during his vacation.
### Sample Input:
```in
two
3 2 1
1 1 1
```
### Sample Output:
```out
one
0
```
answer:If there is no answer, please comment
First of all, we need to know that we can reduce one or two meals on the determination of arrival time and departure time, and then we know that in addition to arrival and departure, we need to complete three meals every day, which means that in a complete case, the difference between the three numbers should not be greater than 1. And because three meals can be seen as a ring, breakfast and lunch are adjacent, lunch and dinner are adjacent, and dinner is adjacent to the next day's breakfast, so we only need to find the maximum of the three numbers, and then complete the other two numbers to a value greater than or equal to the maximum minus one to form a complete three meals.