#include <bits/stdc++.h>
using namespace std;
long long binpow(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
const int N = 100005;
vector<int> g[N];
const double PI = 3.14159265;
void solve() {
  int n;
  cin >> n;
  cout << fixed << setprecision(9) << (double)1 / (tan(PI / (2 * n))) << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long no = 1;
  cin >> no;
  while (no--) {
    solve();
  }
  return 0;
}
