Skip to content

Commit

Permalink
11723 solved
Browse files Browse the repository at this point in the history
  • Loading branch information
ksaveljev committed May 13, 2011
1 parent f979d23 commit f8f63c0
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions 11723.cpp
@@ -0,0 +1,33 @@
#include <iostream>
using namespace std;

int main(void) {
int r, n;
int counter;
int result;

while (cin >> r >> n) {
if (r == 0 && n == 0)
break;

counter++;

cout << "Case " << counter << ": ";

if (n >= r)
result = 0;
else if (n * 27 >= r) {
result = (r - n) / n;
if ((r-n)%n > 0)
result += 1;
} else
result = -1;

if (result == -1)
cout << "impossible" << endl;
else
cout << result << endl;
}

return 0;
}

0 comments on commit f8f63c0

Please sign in to comment.