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