View Code of Problem 64

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

Double click to view unformatted code.


Back to problem 64