#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using ll = long long;
const double PI = 3.14159265359;
long double sq(long double x) { return x * x; }
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int gon = 2 * n;
    int quart = n / 2 - 1;
    long double angledeg = ((gon - 2) * 180.00) / gon;
    long double anglerad = PI - (angledeg * PI / 180);
    long double currx = 0.0;
    long double curry = 0.0;
    long double currangle = 0.0;
    while (quart--) {
      double mul = 1.0;
      currx += cos(currangle) * mul;
      curry += sin(currangle) * mul;
      currangle += anglerad;
    }
    double lensq = sq(currx) + sq(curry);
    double half = sqrt(lensq / 2) + 0.5;
    printf("%.10lf\n", 2 * half);
  }
  return 0;
}
