#include #include #include #define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++) typedef unsigned long long int ll; int main( void ){ ll a, b, c; if (!scanf( "%lld%lld%lld", &a, &b, &c )) return 0; ll time = c / (( a - 1 ) + b ); ll age = a * time; ll money = (( a - 1 ) + b ) * time; if (money < c){ age += c - money; money += c - money; if (c - money < a-1) age += c - money; else age+=a; } printf( "%lld\n", age ); return 0; }