#include<iostream> using namespace std; int main() { int l,n,k; while(cin>>l>>n>>k&&(n!=0||k!=0||l!=0)) { for(int i=2;i<=n;i++) { if(k-k/2+k>1) break; k=k-k/2+k; } cout<<k<<endl; } return 0; }
Double click to view unformatted code.