#include<bits/stdc++.h>
#define ll long long int
#define N 1000007
using namespace std;
long double l[N];
int main()
{
ll t, n, m, i, j = 1;
for(i=1;i<N;i++)
l[i] = l[i-1] + log10(i);
cin >> t;
while(t--)
{
cin >> n >> m;
ll r = floor(l[n]/log10(m)) + 1;
cout << "Case " << j++ << ": " << r << "\n";
}
return 0;
}
#define ll long long int
#define N 1000007
using namespace std;
long double l[N];
int main()
{
ll t, n, m, i, j = 1;
for(i=1;i<N;i++)
l[i] = l[i-1] + log10(i);
cin >> t;
while(t--)
{
cin >> n >> m;
ll r = floor(l[n]/log10(m)) + 1;
cout << "Case " << j++ << ": " << r << "\n";
}
return 0;
}
Comments
Post a Comment