#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
const double Pi = 3.1415926535;
using namespace std;
int debug = 01;
int main() {
  int tst;
  cin >> tst;
  while (tst--) {
    double x;
    cin >> x;
    double ang = Pi / x;
    int y = (int)((x - 2) / 2);
    double z = 1, ans = 0;
    while (y--) ans += cos((y + 1) * ang);
    cout << fixed << setprecision(10) << ans + ans + 1 << "\n";
  }
}
