View Code of Problem 118

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int count = 0;
        while(scanner.hasNext()){
            int n = scanner.nextInt();
            if (n <= 3){
                System.out.println("Case #"+(++count)+": 5");
                continue;
            }
            int res = (int)Math.ceil(5 + (n-3)*1.5);
            System.out.println("Case #"+(++count)+": "+res);
        }
    }
}

Double click to view unformatted code.


Back to problem 118