#include <bits/stdc++.h>
using namespace std;
long long gcd(long long int p, long long int q) {
  if (q == 0) return p;
  return gcd(q, p % q);
}
signed main() {
  long long int t = 1;
  cin >> t;
  while (t--) {
    long long int a, b, n, cnt = 0, p = 0;
    cin >> a >> b >> n;
    p = min(((abs(n - b) / a) + 1), ((abs(a - n) / b) + 1));
    while (1) {
      if (a < b) {
        a += b;
        cnt++;
      } else {
        b += a;
        cnt++;
      }
      if (a > n || b > n) break;
    }
    cout << min(cnt, p) << endl;
  }
  return 0;
}
