Time limit
1s
Memory limit
512 MB
Sungbin, who studies computer science, is especially fond of powers of two. One day, while looking at a calendar, he realized that the year 2048 was approaching. He wondered how likely it was for an arbitrary person to live through a year that is a power of two, and thought that this probability would decrease as time passed.
While staring at the number 2048, Sungbin noticed something interesting: it contains the digits 2, 4, and 8, which are themselves powers of two. This led him to the following question.
Let N be the decimal number formed by writing 2l,2l+1,⋯,2r in decimal notation and concatenating them in that order. How many times can N be divided by 2 consecutively?
The number can become far too large to build directly. Write a program that answers Sungbin's question.
The first line contains an integer T, the number of test cases.
Each test case consists of two integers l and r separated by a space.
For each test case, print one line containing the answer to Sungbin's question.