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