#include <bits/stdc++.h>
using namespace std;
void solve(int b, int a, int n, int c) {
  int temp = a + b;
  a = b;
  b = temp;
  c++;
  if (b > n) {
    cout << c << "\n";
    return;
  }
  solve(b, a, n, c);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  cin >> t;
  while (t--) {
    int a, b, n, c = 0;
    cin >> a >> b >> n;
    if (a < b)
      solve(b, a, n, c);
    else
      solve(a, b, n, c);
  }
}
