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