1368A - C+=

Click to show code.


using namespace std;
int main(void)
{
    int t, a, b, n, ans;
    cin >> t;
    while (t--)
    {
        cin >> a >> b >> n;
        if (a < b)
            swap(a, b);
        ans = 0;
        while (a <= n)
        {
            b += a;
            swap(a, b);
            ++ans;
        }
        cout << ans << endl;
    }
    return 0;
}