View Code of Problem 115

#include <iostream>
using namespace std;

int main(){
  int n;
  long sum1,sum2,j;
  while(scanf("%d",&n)!=EOF){
    sum1=0;
    j=1;
    sum2=100000*n;
    while(n--){
      sum1+=j;
      j*=2;
    }
    printf("%ld %ld\n",sum1,sum2);
  }
  return 0;
}

Double click to view unformatted code.


Back to problem 115