#include<iostream>
using namespace std;
int main()
{
int a, b, c, d, i = 1, n, m;
while(cin >> a >> b)
{
d = 0;
if(a == 0 && b == 0)
break;
if(a == b || a < b)
{
cout << "Case " << i++ << ": " << 0 << endl;
continue;
}
if((a-b)>(b*26))
{
cout << "Case " << i++ << ": " << "impossible" << endl;
continue;
}
c = a-b;
d = c/b;
if(d*b == c)
{
cout << "Case " << i++ << ": " << d << endl;
}
else
{
cout << "Case " << i++ << ": " << d+1 << endl;
}
}
return 0;
}
using namespace std;
int main()
{
int a, b, c, d, i = 1, n, m;
while(cin >> a >> b)
{
d = 0;
if(a == 0 && b == 0)
break;
if(a == b || a < b)
{
cout << "Case " << i++ << ": " << 0 << endl;
continue;
}
if((a-b)>(b*26))
{
cout << "Case " << i++ << ": " << "impossible" << endl;
continue;
}
c = a-b;
d = c/b;
if(d*b == c)
{
cout << "Case " << i++ << ": " << d << endl;
}
else
{
cout << "Case " << i++ << ": " << d+1 << endl;
}
}
return 0;
}
Comments
Post a Comment