@inkysakura
2017-05-06T12:53:36.000000Z
字数 299
阅读 1253
CODE
#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
double sum[1000005];
int ncase;
int main()
{
for(int i=1;i<=1000000;i++)
sum[i]=sum[i-1]+log(i);
int t;
scanf("%d",&t);
while(t--)
{
int n,base;
scanf("%d %d",&n,&base);
printf("Case %d: %d\n",++ncase,(int)(sum[n]/log(base))+1);
}
return 0;
}