每隔64个打个表
#include<bits/stdc++.h>
using namespace std;
#define fst first
#define sec second
#define sci(num) scanf("%d",&num)
#define scl(num) scanf("%lld",&num)
#define mem(a,b) memset(a,b,sizeof a)
#define cpy(a,b) memcopy(a,b,sizeof b)
typedef long long LL;
typedef pair<int,int> P;
const int MAX_N = 1e8;
const int MAX_M = 10000;
double sum[(MAX_N >> 6) + 10];
void init() {
double t = 0;
for (int i = 1;i <= MAX_N;i++) {
t += 1.0 / i;
if ((i & 63) == 0) sum[i >> 6] = t;
}
}
int main() {
init();
int T;
sci(T);
for (int cs = 1;cs <= T;cs++) {
int N;
sci(N);
double ans = sum[(N >> 6)];
for (int i = ((N>> 6)<<6) + 1;i <= N;i++) {
ans += 1.0/i;
}
printf("Case %d: %.15lf\n",cs,ans);
}
return 0;
}