#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy[] = {0, 1, 1, 1, 0, -1, -1, -1};
long long POW(long long x, long long y) {
  long long ans = 1;
  long long base = x;
  while (y) {
    if (y & 1) {
      ans *= base;
    }
    base = base * base;
    y = y >> 1;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n, i, j, k, t, temp;
  long long tc;
  cin >> tc;
  while (tc--) {
    cin >> n;
    n *= 2;
    long double degrees, radians;
    long double PI_val = 3.141592653589;
    radians = ((long double)(PI_val)) / n;
    long double sin_ans = tan(radians);
    long double ans = 1 / sin_ans;
    printf("%0.10Lf\n", ans);
  }
  return 0;
}
