#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int a, b, n, counter = 0;
    cin >> a >> b >> n;
    int current = max(a, b), adding = min(a, b);
    while (current <= n) {
      int temporary = current;
      current += adding;
      adding = temporary;
      counter++;
    }
    cout << counter << "\n";
  }
  return 0;
}
