#include<iostream> #include<math.h> #include<cstring> using namespace std; typedef struct student{ char name[100]; int heigh; int money; }s; int main() { int n,k,l; while(scanf("%d %d %d",&n,&k,&l)!=EOF&&!(n==0&&k==0&&l==0)){ for(int i=2;i<n;i++){ if(k-k/2+k>l){ break; }else{ k=k-k/2+k; } } cout<<k<<endl;; } return 0; } |
Double click to view unformatted code.