#include <bits/stdc++.h>
using namespace std;
const long long mod1 = 1e9 + 7;
const long long mod2 = 998244353;
const int INF = 0x3f3f3f3f;
int t;
long long a, b, n, ans, x[65000], y[65000];
int main() {
  cin >> t;
  x[1] = 1;
  x[2] = 1;
  y[0] = y[1] = 1;
  while (t--) {
    cin >> a >> b >> n;
    ans = 0;
    if (a > b) swap(a, b);
    if (b > n) {
      cout << ans << endl;
      continue;
    }
    ans++;
    while (1) {
      if (x[ans] * a + b * y[ans] > n) {
        cout << ans << endl;
        break;
      }
      ans++;
      x[ans] = x[ans - 1] + x[ans - 2];
      y[ans] = y[ans - 1] + y[ans - 2];
    }
  }
  return 0;
}
