View Code of Problem 115

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main (){
	int n;
	while(~scanf("%d", &n)){
		ll t = 1, s1 = 0, s2 = 0;
		for(int i = 0;i < n;i++){
			s1 += t;
			t *= 2;
			s2 += 100000;
		}
		printf("%lld %lld\n", s1, s2);
	}

	return 0;
}

Double click to view unformatted code.


Back to problem 115