View Code of Problem 115

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int n,x,y,sum;
	while(cin>>n){
		y=100000,x=1,sum=1;
		if(n==1)cout<<sum<<" "<<y<<endl;
		else{
			for(int i=1;i<n;i++){
			x=x*2;
			sum+=x;
			y+=100000;
		}
			cout<<sum<<" "<<y<<endl;
			
		}
		
	}
	
	return 0;
}

Double click to view unformatted code.


Back to problem 115