View Code of Problem 64

#include<iostream>
using namespace std;
int main(){
	int n,k,L;
	
	while(cin>>n>>k>>L){
		int num=1;
		while(k-k/2+k<L){
			if(num==n-1)break;
			k=k-k/2+k;
			num++;
		}
		cout<<k<<'\n';
		
	}
	
}

Double click to view unformatted code.


Back to problem 64