/**
* 03.01 21:13
*
**/
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
int m, n;
scanf("%d", &m);
for (int j = 0; j < m; j++) {
scanf("%d", &n);
double sum = 0;
for (int i = 1; i <= n; i++) {
if (i % 2 != 0) {
sum += 1.0 / i;
} else {
sum -= 1.0 / i;
}
}
printf("%.2lf\n", sum);
}
return 0;
}