A tower has floors numbered through from bottom to top. Initially, monkeys hang from floor .
Ishigami and Iino take turns removing one remaining floor. Ishigami moves first. When a floor is removed, all monkeys hanging from it move to the highest remaining floor below it. If no such floor exists, they fall to the ground, and the player who removed the floor scores one point for each monkey that falls.
The game continues until all floors have been removed. Each player acts to maximize their own final score. Find both players' final scores.
The input is given in the following format:
For each test case, print Ishigami's final score and Iino's final score, in that order, on one line.
In the second case, Ishigami can remove floor , Iino can remove floor , and Ishigami can remove the last floor. Their scores are and .
Each case is given in the following format:
is the number of test cases. is the number of floors, and is the initial number of monkeys on floor .
| 3 | 52 | No additional constraints. |