View Code of Problem 64

#include<iostream>
using namespace std;
int main()
{
	int n,k,l;
	while(cin>>n>>k>>l&&(n!=0||k!=0||l!=0))
	{
		int a=n,b=k,c=l;
		for(int i=0;i<n-2;i++)
		{
			if(b-b/2+b>c)
			{
				break;
			}
			else	
			{
				b=b-b/2+b;
			}	
		}
		cout<<b<<endl;
	}
}

Double click to view unformatted code.


Back to problem 64