Թաքցված խնդիր
|Այս խնդիրը թաքցված է խմբագրական խրհրդի անդամի կողմից քանի որ կամ այն ոչ ճիշտ լեզվով է գրված,|կամ թեստային տվյալներն են սխալ, կամ խնդրի ձևակերպումը պարզ չէ։|

ACM_0202 - GOLD RUSH

   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 tried to carry the gold out the cave, but it was still to 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 weights 2n femto-grams (1015) and n can reach 62.”

   Bob answered: “What luck! Alice’s knapsack can carry up to a femto-grams and mine b femto-grams 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?

Input

   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

   Output one line for every test case with the minimal number of days that Alice and Bob are locked in the cave.

Examples

stdin

stdout

1

3
2 2 2
2 1 3
10 1000 24

1
2
7


Ավելացրեց.Հրանտ Հովհաննիսյան
Ամսաթիվ.2014-10-08
Ժամանակի սահմանափակումը.1s
Ծրագրի տեքստի սահմանափակումը.50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Լեզուներ.Բոլորը բացի ASM32 ASM64 GAWK CLPS CLOJURE D ERL FSHARP FORTRAN GOSU HASK ICON ICK NEM NIM OBJC-CLANG PICO PIKE PYPY PYPY3 PY_NBC RUST SCM guile CHICKEN SED TCL WHITESPACE
Աղբյուրը.German (GCPC) 2014.F

© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.