#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
const int maxn = 1e5+10;
int n;
double p[maxn];
void init(){
p[1] = 1.0;
for(int i = 1 ; i < maxn ; i++) {
p[i+1] = (1-0.5/i)*p[i];
}
}
int main() {
init();
int T;
scanf("%d", &T);
while (T--) {
scanf("%d", &n);
printf("%.4lf\n", 1-p[n/2]);
}
}