This problem is a programming version of Problem 207 from projecteuler.net
For some positive integers , there exists an integer partition of the form ,
where , and are all positive integers and is a real number.
The first two such partitions are and .
Partitions where is also an integer are called .
For any let be the proportion of such partitions that are perfect with .
In the following table are listed some values of
Find the smallest for which .
First line of each test file contains a single integer that is the number of queries per test file. lines follow, with two integers and separated by a single space on each.
Print exactly lines with an answer for the corresponding query on each.
Sample Input 0
Sample Output 0
, but , therefore, an answer for the first query is .
, which is the first value less than among all where .