| Abakoda Long 2024 Contest |
|---|
| Finished |
Welcome one, welcome all, to the Great Penchick Race!
Alice, Bob, and Cindy have started racing their respective penchicks in a three-way parkour race battle. Alice's penchick has already traversed a distance of $$$a$$$ units, Bob's penchick has already traversed a distance of $$$b$$$ units, and Cindy's penchick has already traversed a distance of $$$c$$$ units.
The way the penchicks move is a bit quirky, actually.
Thus, Alice and Bob and Cindy agreed to collude such that all three of their penchicks will be equally distant from the starting line, and then end the race there. They can choose the integer $$$k$$$ each round, and also they can decide whose penchicks hop, skip, and jump.
Determine if this task is possible, and if it is, try to achieve it in as few rounds as possible.
The first line of input contains a single integer $$$T$$$, denoting the number of test cases. The descriptions of $$$T$$$ test cases follow.
Each test case consists of a single line containing the three space-separated integers $$$a$$$ and $$$b$$$ and $$$c$$$.
For each test case:
There will be exactly one file with $$$T = 10^4$$$ test cases, with $$$1 \leq a, b, c \leq 10^9$$$ in each one; also, it is not the case that $$$a = b = c$$$. If your answer is incorrect on any of the test cases (said yes when it's impossible; said no when it is possible; used too many rounds; proposed a construction doesn't achieve the goal; etc.), you get a $$$0$$$.
Otherwise, you get a higher score the fewer rounds you use (in the cases where the task is possible), with a perfect score if you use the minimal number of rounds in all (possible) test cases.
Let $$$n$$$ be the number of rounds you used in some test case, and let $$$m$$$ be the number of rounds used by the judge.
The sample test file is also included (with $$$T=2$$$) but you do not actually need to get it correct in order to get points.
2 15 14 7 1 1 2
4 6 2 1 3 2 3 2 1 5 1 3 2 1 2 1 3 -1
This may not necessarily be the optimal way to answer the first test case.
Still, we see that it is at the very least correct:
| Name |
|---|


