#Lutece0568. Battery Charging

Battery Charging

Migrated from Lutece 568 Battery Charging

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

Recently, qbwj bought a powerful cellphone which performs even better than most computers. He spent lots of time on it. However, this cellphone has a very strange feature which confused qbwj. There is a battery with infinite capacity in the cellphone. On each day, qbwj has three choices: use the cellphone, charge the battery or do nothing. He cannot do using and charging on the same day. Charging on the kthk_{th} day adds kk units of power to the battery. If qbwj chooses to use the cellphone on the kthk_{th} day, it would consume kk units of power. Note that qbwj can choose to use the cellphone if and only if there are enough units of power in the battery.

Despite of the strengths of the cellphone, qbwj couldn't suffer it any more. So he decides to sell it at the end of TthT_{th} day. Today is the Sth day and the battery is empty now. He wants to know how many days at maximum he can use the cellphone before selling it out.

Note that qbwj can still choose to use the cellphone on both the SthS_{th} day and TthT_{th} day.

Input

The first line of the input will be an integer NN (N10000N \leq 10000) indicating the number of cases.

For each test case, two integers are given on a single line: SS TT. 1ST1081 \leq S \leq T \leq 10^8.

Output

Print Case #k: d in a single line for each test case, in which kk represents the case number which starts from 11, and dd is the answer.

Samples

3
3 6
3 9
1 100000
Case #1: 1
Case #2: 3
Case #3: 49994

Note

For the first sample, we charge the cellphone on the 3rd3_{rd}, 4th4_{th}, 5th5_{th} day and use it on the 6th6_{th} day.

Resources

10th UESTC Programming Contest Final