Cow`s Segment

TimeLimit:3000MS  MemoryLimit:262144KB
64-bit integer IO format:%I64d
未提交 | 登录后收藏
Problem Description
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\times a$ and $i \times b$ should be reported. Once there exists an integer in the segment $[i \times a, i \times b]$, the game ends. Now, John wants to know after how many turns the game would end. So, he ask for your help.
Input
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$.
Output
For each test case, output an integer $n$ donating that the game will end in $n$ turns.
SampleInput
1
1.2 1.3
SampleOutput
4
Submit
题目统计信息详细
总AC数0
通过人数0
尝试人数0
总提交量0
AC率0.00%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签
出处

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: