View Code of Problem 64

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

Double click to view unformatted code.


Back to problem 64