View Code of Problem 64

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

Double click to view unformatted code.


Back to problem 64