#include <bits/stdc++.h>
using namespace std;
const int N = 3e5;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long a, b, n;
    cin >> a >> b >> n;
    int count = 0;
    if (a < b) swap(a, b);
    while (a <= n) {
      ++count;
      b += a;
      if (a < b) swap(a, b);
    }
    cout << count << "\n";
  }
}
