You may have heard of Nostradamus. He was a Jewish Frenchman from the early 16th century and the most famous prophet in the world for the last 400 years. During his lifetime, he left behind "Les Prophéties," a collection of quatrains that has become an essential book for many occult enthusiasts studying future prophecies. Centuries later, the descendants of Nostradamus formed a mysterious group of prophets, each possessing outstanding predictive abilities. This mysterious group of prophets uses a collective strategy to improve the overall prediction accuracy of the group. Suppose there are $n$ prophets in the group, and they can each independently predict the outcome of a random event, such as whether a tossed coin lands heads or tails, with a prediction accuracy of $p$. Consider the following collective prediction strategy: use the prediction conclusion of more than half of these $n$ prophets as the collective prediction conclusion. For example, when predicting the result of a coin toss, if more than half of the prophets predict heads, the collective strategy predicts heads; otherwise, the collective strategy predicts tails. With this strategy, if $p = 81\%$, it can be calculated that for $n = 3$, the probability of the collective strategy being correct is $90.54\%$. Compared to a single prophet, the collective strategy significantly improves the prediction accuracy. In fact, when $p = 81\%$, as long as $n \ge 3$, the prediction accuracy of the collective strategy is no less than $90\%$.
In the Reliable Prophet problem, given the accuracy $p$ of a single prophet independently predicting a random event and the desired prediction accuracy $q$ to be achieved by the collective prediction strategy, calculate the minimum number of mutually independent prophets required to work together so that the prediction accuracy of the collective strategy is no less than $q$.
Implementation Details
Given the accuracy $p$ of a single prophet independently predicting a random event and the desired prediction accuracy $q$ to be achieved by the collective strategy, design an algorithm to calculate the minimum number of mutually independent prophets required to work together so that the prediction accuracy of the collective strategy is no less than $q$.
Input
There are $k$ test cases ($1 \le k \le 10$), with each line providing one test case. Each test case consists of two real numbers $p$ and $q$. Here, $p$ is the accuracy of a single prophet's prediction, and $q$ is the desired prediction accuracy to be achieved by the collective strategy.
Output
Output the minimum number of prophets required for each test case sequentially. Output one number per line. If the requirement cannot be met by any number of prophets, output -1.
Examples
Input 1
0.81 0.90 0.60 0.90 0.40 0.40 0.90 0.80 0.49 0.50
Output 1
3 41 1 1 -1