#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 1; i <= t; i++) {
    int a;
    int b;
    int n;
    cin >> a >> b >> n;
    if (a < b) swap(a, b);
    int k = 0;
    while (b <= n) {
      if (a < b) swap(a, b);
      k++;
      b += a;
    }
    cout << k << endl;
  }
  return 0;
}
