#include #include #include #include #include #include #include #include #include #define L64 long long #define MOD (1000000007LL) bool checkLt(L64 age, L64 a, L64 b, L64 c) { L64 z = age / a; //L64 x = z * b + age - z; //return x < c; //z * b < c - age + z if((c - age + z) % b == 0){ return z < (c - age + z) / b; } else { return z <= (c - age + z) / b; } } int main(void) { L64 a, b, c; std::cin >> a >> b >> c; L64 min, max; min = 0; max = c; while(1LL < max - min){ L64 mid = (min + max) / 2LL; bool ret = checkLt(mid, a, b, c); if(ret){ min = mid; } else { max = mid; } } std::cout << max << std::endl; }