#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  for (int loop = 0; loop < (T); ++loop) {
    int n;
    cin >> n;
    int m = n * 2;
    double PI = 3.14159265358979;
    double hh = (1.0 / 2.0) / sin(360.0 / (n * 4) * PI / 180.0);
    double ans = (1.0 / 2.0) / tan(360.0 / (n * 4) * PI / 180.0) * 2.0;
    if (n % 2 == 1) {
      ans = hh * cos(360.0 / m / 4.0 * PI / 180.0) * 2;
    }
    cout << fixed << setprecision(10) << ans << endl;
  }
}
