#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, a, b, k;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> a >> b >> k;
    int mi = min(a, b), ma = max(a, b), count = 0;
    while (mi <= k && ma <= k) {
      mi += ma;
      int p = min(mi, ma);
      int l = max(mi, ma);
      mi = p;
      ma = l;
      count++;
    }
    cout << count << "\n";
  }
}
