p467.in1
======================
1
2

=================
p467.cpp
======================
#include <bits/stdc++.h>

using namespace std;

template<typename T1, typename T2>
ostream& operator<<(ostream& out, const pair<T1, T2>& x) {
    return out << x.first << ' ' << x.second;
}

template<typename T1, typename T2>
istream& operator>>(istream& in, pair<T1, T2>& x) {
    return in >> x.first >> x.second;
}

template<typename T>
istream& operator>>(istream& in, vector<T>& a) {
    for(auto& x: a) {
        in >> x;
    }
    return in;
};

template<typename T>
ostream& operator<<(ostream& out, const vector<T>& a) {
    for(auto x: a) {
        out << x << ' ';
    }
    return out;
};

int p;

void solve() {
    // The trick in this problem is that we can compute the answer in advance and
    // then answer everything in O(1). This should be obvious by realizing that there
    // are only 100 possible values for p, and we can compute the answer for each one.
    //
    // The other observation is that the answer is small, and certainly less than 4. 
    // 1) For cnt = 1, we can cover the whole board with 1 laser. Assuming that the board 
    //    is 1x1, the diameter is sqrt(2) and the radius of the circle is 1/2. Then the
    //    area is pi * (1/2)^2 = pi/4, or roughly 78.5%.
    // 2) For cnt = 2 and cnt = 3, we can simply brute force all positions of the laser,
    //    up to some precision. We can notice that for 3 lasers, it's quite easy to find
    //    a solution with 99% coverage, and for 2 lasers, we can simply use precision that
    //    is roughly 500 and find a solution with 95% coverage.
    // 4) We can show that to get 100% coverage, we need at 3 circles of radius at least
    //    sqrt(65)/16, which is a bit over the radius of 1/2 we have. A relevant page for 
    //    this is: https://www.quora.com/A-unit-square-is-completely-covered-by-three-
    //             identical-circles-Find-the-smallest-possible-diameter-of-the-circles
    //    Hence, the answer of 99% is satisfactory for 3 lasers too, and we don't have to
    //    use too much compute.

    if(p == 0) {
        cout << 0 << '\n';
    } else if(p <= 78) {
        cout << 1 << '\n';
    } else if(p <= 95) {
        cout << 2 << '\n';
    } else if(p <= 99) {
        cout << 3 << '\n';
    } else {
        cout << 4 << '\n';
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    for(int test = 1; cin >> p; test++) {
        cout << "Case #" << test << ": ";
        solve();
    }

    return 0;
}

=================
p467.ans1
======================
Case #1: 1
Case #2: 1

=================
statement.txt
======================
467. Chessmaster
Time limit per test: 0.25 second(s)
Memory limit: 262144 kilobytes
input: standard
output: standard



Ivan Petrovich and Petr Ivanovich enjoy playing chess, especially Ivan Petrovich. Each time he loses regular weekend game in chess, from superfluity of feelings he takes the board and breaks it into separate black and white fields. Well, things were going that way before Petr Ivanovich, frustrated by weekly breakages of his chessboards, replaced usual chessboard by titanic one. Now it was not so easy even to scratch it! But Ivan Petrovich didn't become flustered and, in affective state after usual unsuccessful play, ordered a powerful laser which could burn accurate perfectly round holes through the chessboard.

Only after the laser was delivered Ivan Petrovich realized to his horror that it was not powerful enough: instead of having diameter of a beam equal to the diagonal of a chessboard, his laser had diameter equal to the length of its side! This means that he will be unable to destroy the whole chessboard in one shot, and will have to use the laser several times. But Ivan Petrovich's pension is not large enough to cover bills for electricity after using the laser too frequently, so now he is puzzled with natural question: if he wishes to destroy at least P percents of the chessboard surface, what is the minimum number of laser shots that he have to do?

Help Ivan Petrovich in answering this important and difficult question. And remember: you may shoot only in direction orthogonal to the surface of chessboard, and it is not allowed to move (probably) peeled off parts. Chessboard has the usual form of a perfect square.

Input
Input file contains up to 100 non-negative integer numbers, each on a separate line — percentage of the board P that Ivan Petrovich wants to destroy. Each P will not exceed 100, of course.

Output
For every P in the input file write to the output file on a separate line required minimum number of laser shots. Follow format shown in the example below.

Example(s)
sample input
sample output
1
2
Case #1: 1
Case #2: 1

=================
