View Code of Problem 64

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

Double click to view unformatted code.


Back to problem 64