#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    ll a, b, n;
    cin >> a >> b >> n;
    if (a > b) swap(a, b);
    int ans = 0;
    while (b <= n) {
      ans++;
      a += b;
      if (a > b) swap(a, b);
    }
    cout << ans << '\n';
  }
}
