#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  vector<int> ans(t, 0);
  for (int i = 0; i < t; i++) {
    int a, b, n;
    cin >> a >> b >> n;
    if (b < a) {
      int t = a;
      a = b;
      b = t;
    }
    int m = b;
    while (m <= n) {
      m = a + b;
      a = b;
      b = m;
      ans[i]++;
    }
  }
  for (int i = 0; i < t; i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
