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