#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, n, a, b, p, q, z, k;
  cin >> t;
  while (t--) {
    z = 0;
    k = 0;
    cin >> a >> b >> n;
    p = max(a, b);
    q = min(a, b);
    while (k <= n) {
      z++;
      k = q + p;
      q = p;
      p = k;
    }
    cout << z << endl;
  }
}
