#33551: ANS C++


yp11151097@yphs.tp.edu.tw (908-30施耀登)


#include<bits/stdc++.h>
using namespace std;
main(){
int n,k,w;
while(cin>>n>>k>>w){
    int ans=n;
    while(n>=k) {
        ans+=n/k*w; n=n%k+n/k*w;
    }
    cout<<ans<<endl;
}
}