#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define INF 1145141919 #define INF_INT_MAX 2147483647 #define INF_LL_MAX 9223372036854775807 #define EPS 1e-10 #define Pi acos(-1) #define LL long long #define ULL unsigned long long using namespace std; LL A, B, T; int main() { cin >> A >> B >> T; LL ans = INF_LL_MAX; for (LL i = 0; i <= A && B*i <= T + B; i++){ ans = min(ans, B*i + A*((T - B*i + A - 1) / A)); } cout << ans << endl; return 0; }