2022-08-18 09:19:19 +08:00
|
|
|
|
//<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һλ<D2BB><CEBB><EFBFBD>ֶԲ<D6B6><D4B2><EFBFBD>
|
2022-08-17 10:22:11 +08:00
|
|
|
|
#include <iostream>
|
|
|
|
|
#include<cstdio>
|
|
|
|
|
#include<algorithm>
|
|
|
|
|
#include <cmath>
|
|
|
|
|
#include <cstdlib>
|
|
|
|
|
using namespace std;
|
|
|
|
|
const int N=1e8;
|
2022-08-18 09:19:19 +08:00
|
|
|
|
const int w=50;
|
|
|
|
|
double a[N/w+5];
|
2022-08-17 10:22:11 +08:00
|
|
|
|
int t,n;
|
|
|
|
|
int t1;
|
|
|
|
|
inline void cun()
|
|
|
|
|
{
|
2022-08-18 09:19:19 +08:00
|
|
|
|
int cur=1;
|
|
|
|
|
for(int i=1;i<=N;i++)
|
2022-08-17 10:22:11 +08:00
|
|
|
|
{
|
2022-08-18 09:19:19 +08:00
|
|
|
|
a[cur]+=(1.0/i);
|
|
|
|
|
if(i%w==0)
|
|
|
|
|
{
|
|
|
|
|
// printf("%llf,",a[cur]);
|
|
|
|
|
cur++;
|
|
|
|
|
a[cur]=a[cur-1];
|
|
|
|
|
}
|
2022-08-17 10:22:11 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//void ce()
|
|
|
|
|
//{
|
|
|
|
|
// cout<<cnt;
|
|
|
|
|
// for(int i=1;i<=cnt;i++)
|
|
|
|
|
// {
|
|
|
|
|
// cout<<pr[i]<<" ";
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
int main()
|
|
|
|
|
{
|
2022-08-18 09:19:19 +08:00
|
|
|
|
cun();
|
|
|
|
|
// ce();
|
|
|
|
|
scanf("%d",&t);
|
|
|
|
|
while(t--)
|
|
|
|
|
{
|
|
|
|
|
scanf("%d",&n);
|
|
|
|
|
int now=n/w;
|
|
|
|
|
double ans=a[now];
|
|
|
|
|
for(int i=now*w+1;i<=n;i++)
|
|
|
|
|
{
|
|
|
|
|
ans+=(1.0/i);
|
|
|
|
|
}
|
|
|
|
|
printf("Case %d: %.10llf\n",++t1,ans);
|
|
|
|
|
}
|
2022-08-17 10:22:11 +08:00
|
|
|
|
return 0;
|
|
|
|
|
}
|