#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int test, cs = 1;
  cin >> test;
  while (test--) {
    int a, b, n;
    cin >> a >> b >> n;
    int cnt = 0;
    while (max(a, b) <= n) {
      if (a > b) swap(a, b);
      a += b;
      cnt++;
    }
    cout << cnt << endl;
  }
}
