Codeforces Round 820 (Div. 3) |
---|
Finished |
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.
There are only two elevators in his house. Vlad knows for sure that:
If you call the first elevator, it will immediately start to go to the floor $$$1$$$. If you call the second one, then first it will reach the floor $$$c$$$ and only then it will go to the floor $$$1$$$. It takes $$$|x - y|$$$ seconds for each elevator to move from floor $$$x$$$ to floor $$$y$$$.
Vlad wants to call an elevator that will come to him faster. Help him choose such an elevator.
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases.
This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output:
31 2 33 1 23 2 1
1 3 2
In the first test case of the example, the first elevator is already on the floor of $$$1$$$.
In the second test case of the example, when called, the elevators would move as follows:
In the third test case of the example, the first elevator will arrive in $$$2$$$ seconds, and the second in $$$1$$$.
Name |
---|