/* * * \OoO/ * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long int; using ld = long double; #define iamtefu ios_base::sync_with_stdio(false); cin.tie(0); #define fl(i,a,n) for (ll i(a); i=a; i--) #define print(a) for (auto x:a){cout<>tt; for(;tt--;) template inline L chmax(L &a, R b){if (a inline L chmin(L &a, R b){if (a>b){a=b; return true;} return false;} template ostream& operator<<(ostream &fout, pair &p){ fout<<"{"< ostream& operator<<(ostream &fout, vector &v){ for (auto &x:v){ fout< ostream& operator<<(ostream &fout, set &st){ for (auto &x:st){ fout< ostream& operator<<(ostream &fout, map &mp){ fout<<"["; for (auto &[x,y]:mp){ fout<>=1; } return res; } mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count()); void scn(){ ll a, b, k; cin>>a>>b>>k; ll c=(a*b/gcd(a,b)); auto wh=[&](ll mid){ ll a1=mid-(mid/a+(mid/b)-(mid/(c))); return a1>=k; }; ll l=0, r=4e18; while (l<=r){ ll mid=(l+r)/2; if (wh(mid)){ r=mid-1; } else { l=mid+1; } } cout<(t2-t1).count(); ti*=1e-6; cerr<<"Time elapsed: "<