#include using namespace std; #define int long long templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> v >> t >> p; int ans = (p+1)*v + 1; int tmp = ans-1; while(tmp >= t){ int plus = tmp / t; ans += plus; tmp = plus + tmp%t; } cout << ans << endl; return 0; }