Cow's Segment
题号:NC14308
时间限制:C/C++/Rust/Pascal 2秒,其他语言4秒
空间限制:C/C++/Rust/Pascal 64 M,其他语言128 M
64bit IO Format: %lld

题目描述

Farmer John is playing math game with cows. To help his cows learning addition and multiplication, he invented a new game. In the beginning, he would provide two number a and b. After that, cows would report two number each turn. At the turn i, i*a and i*b should be reported. Once there exists an integer in the segment [i*a, i*b], the game ends. Now, John wants to know after how many turns the game would end. So, he ask for your help.

输入描述:

The first line is the number of test cases. For each test case, there are two non-negative float-point numbers a and b. The precision of these numbers are less than 300 decimal places. It is guaranteed that a < b.

输出描述:

For each test case, output an integer n donating that the game will end in n turns.
示例1

输入

复制
1
1.2 1.3

输出

复制
4