View Code of Problem 115

#include<bits/stdc++.h>
using namespace std;

int main()
{
	int n;
	
	while (cin>>n) {
		int x = 1, y = 100000;
		int sum = 1;
		for (int i = 1; i < n; i++) {
			x = 2 * x;
			sum +=  x;
			y += 100000;
		}
	cout << sum << " " << y << endl;
	}
	
}

Double click to view unformatted code.


Back to problem 115