Berland State University has received a new update for the operating system. Initially it is installed only on the 11-st computer.
Update files should be copied to all nn computers. The computers are not connected to the internet, so the only way to transfer update files from one computer to another is to copy them using a patch cable (a cable connecting two computers directly). Only one patch cable can be connected to a computer at a time. Thus, from any computer where the update files are installed, they can be copied to some other computer in exactly one hour.
Your task is to find the minimum number of hours required to copy the update files to all nn computers if there are only kk patch cables in Berland State University.
The first line contains a single integer tt (1≤t≤10**51≤t≤10**5) — the number of test cases.
Each test case consists of a single line that contains two integers nn and kk (1≤k≤n≤10**181≤k≤n≤10**18) — the number of computers and the number of patch cables.
For each test case print one integer — the minimum number of hours required to copy the update files to all nn computers.
4
8 3
6 6
7 1
1 1
4
3
6
0