#include <bits/stdc++.h>
using namespace std;
long long i, j, t, s = 0, c = 0, n, m = 0, k = 0, k1 = 0, k2 = 0, k3 = 0,
                   k4 = 0, k5 = 0;
string s1;
signed main() {
  cin >> t;
  while (t--) {
    long long a, b;
    cin >> a >> b >> n;
    k1 = max(a, b);
    k2 = min(a, b);
    c = 0;
    for (i = 1;; i++) {
      if (k1 + k2 > n) {
        c++;
        break;
      } else {
        c++;
        k3 = k1;
        k1 = k1 + k2;
        k2 = k3;
      }
    }
    cout << c << "\n";
  }
}
