Codeforces Global Round 8
A
C+=
Codeforces
800
原题
←B →
翻译中…

Leo has developed a new programming language C+=. In C+=, integer variables can only be changed with a "+=" operation that adds the right-hand side value to the left-hand side variable. For example, performing "a += b" when a = $2$, b = $3$ changes the value of a to $5$ (the value of b does not change).

翻译中…

In a prototype program Leo has two integer variables a and b, initialized with some positive values. He can perform any number of operations "a += b" or "b += a". Leo wants to test handling large integers, so he wants to make the value of either a or b strictly greater than a given value $n$. What is the smallest number of operations he has to perform?

翻译中…

Input

翻译中…

The first line contains a single integer $T$ ($1 \leq T \leq 100$) — the number of test cases.

翻译中…

Each of the following $T$ lines describes a single test case, and contains three integers $a, b, n$ ($1 \leq a, b \leq n \leq 10^9$) — initial values of a and b, and the value one of the variables has to exceed, respectively.

翻译中…

Output

翻译中…

For each test case print a single integer — the smallest number of operations needed. Separate answers with line breaks.

翻译中…

Note

翻译中…

In the first case we cannot make a variable exceed $3$ in one operation. One way of achieving this in two operations is to perform "b += a" twice.

翻译中…

样例

Input #1
2
1 2 3
5 4 100
Output #1
2
7
InputCopy OutputCopy
题目信息
题号
1368A
时间限制
2 s
内存限制
512 MB
标签
暴力
贪心
模拟
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。