View Code of Problem 115

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while(scanner.hasNext()) {
			int n = scanner.nextInt();
			int rich = 0,poor = 0;
			for(int i = 0;i < n;i++) {
				rich += Math.pow(2, i);
				poor = (i + 1) * 100000;
			}
			System.out.println(rich +" "+poor);
		}
	}
}

Double click to view unformatted code.


Back to problem 115