#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define all(x) (x).begin(),(x).end() #define rep(i,m,n) for(int i = m;i < n;++i) #define pb push_back #define fore(i,a) for(auto &i:a) #define rrep(i,m,n) for(int i = m;i >= n;--i) #define INF INT_MAX/2 using namespace std; using ll = long long; using R = double; using Data = pair>; const ll MOD = 1e9 + 7; const ll inf = 1LL << 50; struct edge { ll from; ll to; ll cost; }; ll a, b, c; ll check(ll p) { ll tot = (p / a)*(b + a - 1) + p -(a * (p / a)); return tot >= c; } int main() { cin >> a >> b >> c; ll ng = 0LL; ll ok = 1e18 + 1LL; while (ok - ng > 1) { ll mid = (ok + ng) / 2; if (check(mid)) { ok = mid; } else { ng = mid; } } cout << ok << endl; return 0; }