#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  int t;
  cin >> t;
  while (t--) {
    int a, b, n;
    cin >> a >> b >> n;
    int i = 0;
    for (; a <= n && b <= n; i++) {
      if (a >= b)
        b += a;
      else
        a += b;
    }
    cout << i << endl;
  }
}
