-
Notifications
You must be signed in to change notification settings - Fork 1
/
A_C.cpp
73 lines (65 loc) · 1.5 KB
/
A_C.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <algorithm>
#include <iostream>
#include <cstring>
#include <climits>
#include <cstdio>
#include <cmath>
#include <unordered_map>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <map>
#include <set>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef map<ll, ll> mll;
typedef set<ll> sll;
typedef queue<ll> qll;
typedef queue<pll> qpll;
#define all(x) x.begin(), x.end()
#define sz(x) (ll) x.size()
#define fr front()
#define bk back()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define FOR(i, a, b, inc) for (ll i = a; i < b; i += inc)
#define RFOR(i, a, b, inc) for (ll i = b - 1; i >= a; i -= inc)
#define REP(i, a) FOR(i, 0, a, 1)
#define RREP(i, a) RFOR(i, 0, a, 1)
#define each(a, x) for (auto& a: x)
const ll INF = 1e9;
const ll M = 1e9 + 7;
ll gcd(ll a, ll b) {
if (b == 0) return a;
return gcd(b, a%b);
}
ll pow(ll a, ll b) {
if (b == 0) return 1;
if (b == 1) return a;
ll x = pow(a, b/2);
if (b%2 == 0) return x*x;
return x*x*a;
}
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll t; cin >> t;
while (t--) {
ll a, b, n; cin >> a >> b >> n;
ll ans = 0;
while (a <= n && b <= n) {
if (a < b) a += b;
else b += a;
ans++;
}
cout << ans << '\n';
}
}