Forgot Password ?
New password will be sent to following email id
Problem Code : VHUG
2 4 1 9 2
Time Limit :
C , C++ , Java , Python 2
Login to submit your response.
<p>Since it is Hug day He wants to visit her for obvious reasons, but he is also in the organising team at Asmita. Now since he is a part of the asmita team He has to organise the <b>K<sup>th</sup></b> round of the Tennis tournament. Each match takes 1 hour. Now he wants to find out how much time will it take him to organize the <b>K<sup>th</sup></b> round if the number of initial participants is <b>N</b>. In each round every player plays with one of the other player and each player can play only once in a round. Also as there is only one tennis court in college only one match can take place at a time.</p> <p>Since he is not very good at calculations, he wants you to help him find the number of hours it will take to complete the <b>K<sup>th</sup></b> round so that he can tell her that he will come to her after this much time.</p> <p><strong>Note</strong> :- If there are odd number of players in a round, one of the players will get a bye(Bye means the odd player gets entry to next round without participating in any match). The tournament will be of a knockout format taking place between two players and the loser of any match will be directly eliminated.
First Line contains <b>T</b> i.e. the number of testcases.<br> Next <b>T</b> line contains two integers <b>N</b> and <b>K</b>. <br>
For each testcase output the number of hours it takes for the <b>K<sup>th</sup></b> round to get over.
1 ≤ <b>T</b> ≤ 10<sup>4</sup> <br> 1 ≤ <b>N</b> ≤ 10<sup>18</sup> <br> 1 ≤ <b>K</b> ≤ 60 <br>
4 1 : in 1<sup>st</sup> round there are 4 players hence two matches takes 2 hours.<br> 9 2 : in 2<sup>nd</sup> round there will be 5 players hence two matches 2 hours.