View Code of Problem 118

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


int main() {
	int n;
	int k = 1;
	while (cin >> n) {
		if (n <= 3) {
			cout << "Case #" << k++ << ": 5" << endl;
		}
		else {
			cout << "Case #" << k++ << ": " << ceil(5 + 1.5*(n - 3)) << endl;
		}
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 118