#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long a, b, n, sum, i, temp, ans = 1, last;
    cin >> a >> b >> n;
    if (a < b) swap(a, b);
    last = a;
    if (last > n) {
      cout << "0" << endl;
    } else {
      sum = a + b;
      while (sum <= n) {
        ans++;
        temp = sum;
        sum += last;
        last = temp;
      }
      cout << ans << endl;
    }
  }
  return 0;
}
