#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int t;
  cin >> t;
  while (t--) {
    long long int a, b, n;
    cin >> a >> b >> n;
    long long int a1 = max(a, b);
    long long int b1 = min(a, b);
    int ans = 0;
    while (a1 <= n) {
      long long int temp = b1 + a1;
      b1 = a1;
      a1 = temp;
      ++ans;
    }
    cout << ans << endl;
  }
  return 0;
}
