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