The Ice Bucket Challenge collects donations for amyotrophic lateral sclerosis (ALS). Every participant picks one of two options.
A challenged friend picks between the same two options. Everyone who is challenged takes part, and nobody breaks the rules. Nobody pours the ice water and then donates an amount other than 10 baht.
Starting from a single participant, you want the donations to total at least G baht. Find the smallest number of people who have to pour ice water over themselves. G is guaranteed to be a multiple of 10.
The first line has the number of test cases T, where T<100.
Each of the next T lines holds one test case: two positive integers G and K separated by a single space, with G≤107 and K<1000.
For each test case, print on its own line the smallest number of people who have to pour ice water over themselves.
For G=60 and K=10, the first participant donates 100 baht and challenges nobody, which already passes the goal. No one pours ice water.
For G=320 and K=2, the first participant pours ice water, donates 10 baht and challenges two people. One of those two pours ice water, donates 10 baht and challenges two more. The remaining three each donate 100 baht. The total is 320 baht and two people poured ice water.