#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
int main()
{
long long a;
long long pot = 0;
while (cin >> a)
{
if (a == 0)
{
break;
}
pot++;
long long num = 0, cast[100005];
for (int i = sqrt(a);i >= 1;i--)
{
if (a % i == 0)
{
cast[++num] = i + a / i;
}
}
long long maxx = 0x3f3f3f;
for (int i = 1;i <= num;i++)
{
maxx = min(cast[i], maxx);
}
cout << "case " << pot << ": " << maxx << endl;
}
return 0;
}
为什么会WA,本蒟蒻很疑惑,明明样例都能过