View Code of Problem 64

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

Double click to view unformatted code.


Back to problem 64