#include using namespace std; #define int long long int n,a,b,ans; signed main() { cin>>a>>b>>n; if(n==1) { cout<<0; return 0; } ans=a+(n-1)*b; for(int i=2;(1ll<<(i-1))<=n;i++) { priority_queue,greater > p; int j=i,now=1; for(int k=1;k<=i;k++) { now*=2; p.push(2); } while(now