Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdio>
- #include <algorithm>
- #include <cstring>
- #include <string>
- #include <cctype>
- #include <stack>
- #include <queue>
- #include <list>
- #include <vector>
- #include <map>
- #include <set>
- #include <sstream>
- #include <stdlib.h>
- #include <cmath>
- #define LL unsigned long long
- using namespace std;
- int main() {
- int n,r;
- int test=0;
- while(scanf("%d %d",&r,&n)){
- test++;
- if(n==0 && r==0) break;
- if(r<=n){
- printf("Case %d: 0\n",test);
- }else{
- if(27*n<r){
- printf("Case %d: impossible\n",test);
- }else{
- int d=r/n;
- if(r%n==0) d--;
- printf("Case %d: %d\n",test,d);
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement