40 lines
512 B
C++
40 lines
512 B
C++
|
#include <iostream>
|
||
|
#include<cstdio>
|
||
|
#include<algorithm>
|
||
|
#include <cmath>
|
||
|
#include <cstdlib>
|
||
|
using namespace std;
|
||
|
const long long M=1e17;
|
||
|
const int N=1e8;
|
||
|
double a[N+5]={0};
|
||
|
int t,n;
|
||
|
int t1;
|
||
|
inline void cun()
|
||
|
{
|
||
|
a[0]=0;a[1]=1;
|
||
|
for(int i=2;i<=N;i++)
|
||
|
{
|
||
|
a[i]=a[i-1]+(1.0/i);
|
||
|
}
|
||
|
}
|
||
|
//void ce()
|
||
|
//{
|
||
|
// cout<<cnt;
|
||
|
// for(int i=1;i<=cnt;i++)
|
||
|
// {
|
||
|
// cout<<pr[i]<<" ";
|
||
|
// }
|
||
|
//}
|
||
|
int main()
|
||
|
{
|
||
|
cun();
|
||
|
// ce();
|
||
|
scanf("%d",&t);
|
||
|
while(t--)
|
||
|
{
|
||
|
scanf("%d",&n);
|
||
|
printf("Case %d: %.8llf\n",++t1,a[n]);
|
||
|
}
|
||
|
return 0;
|
||
|
}
|