Alice and Bob are on an adventure trip. Deep in the woods, they discover a mysterious deep cave, which they enter flutteringly. They find an old console with a giant bar of gold in it. On the bar, there is a number n. Both try to carry the gold out of the cave, but it is too heavy for one of them.
Suddenly, a little fairy appears in the corner of the cave and approaches Alice and Bob: “This gold is heavy. It weighs 2n femtograms (10–15 grams) and n can reach 62.”
Bob answered: “What luck! Alice's knapsack can carry up to a femtograms and mine b femtograms with a + b = 2n.” Alice interjected: “But how can we divide the gold?”
Fairy: “I can help you with a spell that can burst one piece of gold into two equally weighted ones. But for each single spell, the cave will be locked one additional day.”
Alice consults with Bob to use the help of the fairy and take all of the gold. How long will they be trapped if they are clever?
The input starts with the number t ≤ 1000 of test cases. Then t lines follow, each describing a single test case consisting of three numbers n, a, and b with a, b ≥ 1, a + b = 2n, and 1 ≤ n ≤ 62.
Output one line for every test case with the minimum number of days that Alice and Bob are locked in the cave.
Output for Sample Input
|University of Debrecen; Faculty of Informatics; v. 03/01/2019|