#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, a, b, min = 0, sum;
    cin >> a >> b >> n;
    if (a >= b)
      sum = a;
    else
      sum = b;
    while (sum <= n) {
      if (a >= b) {
        b = a + b;
        sum = b;
      } else {
        a = a + b;
        sum = a;
      }
      min++;
    }
    cout << min << endl;
  }
  return 0;
}
