View Code of Problem 64

#include<stdio.h>
int main(){
int i,j,l,k,n;
  while(scanf("%d%d%d",&n,&k,&l)!=EOF){
    if(n==0&&k==0&&l==0){
    break;
    }
    for(i=2;i<n;i++){
    if(k-k/2+k>l) 
    {break;}
    else{
    k=k-k/2+k;
    }
  }
printf("%d\n",k);
}
}

Double click to view unformatted code.


Back to problem 64