#include <bits/stdc++.h>
int main() {
  long long t, a, b, n;
  scanf("%lld", &t);
  while (t--) {
    long long a, b, n, cnt = 0, mx = 0;
    scanf("%lld %lld %lld", &a, &b, &n);
    while (mx <= n) {
      if (a < b)
        a += b;
      else
        b += a;
      cnt++;
      mx = a > b ? a : b;
    }
    printf("%lld\n", cnt);
  }
  return 0;
}
