#include // #include using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); unsigned long long a, b, c; cin >> a >> b >> c; auto start = clock(); unsigned long long delta = (a - 1); if (delta > c) { cout << c; // cout << "\n" << clock() - start << endl; } else { unsigned long long delta2 = delta + b; if (delta2 > c) { cout << a; // cout << "\n" << clock() - start << endl; } else { unsigned long long n = (unsigned long long)(c / delta2); if (delta + n*delta2 > c) { cout << c + n * (a - delta2); // cout << "\n" << clock() - start << endl; } else { cout << a * (n + 1); // cout << "\n" << clock() - start << endl; } } } }