#include <bits/stdc++.h>
using namespace std;
double n, m = 3.1415926535749;
int t, e;
struct node {
  long long a, b, c;
  friend bool operator<(node a, node b) { return a.c < b.c; }
};
int main() {
  std::ios::sync_with_stdio(0);
  std::cin.tie(0);
  cin >> t;
  double a, b, c, d = 90.000;
  while (t--) {
    cin >> n;
    b = 0;
    e = 1;
    while (e * 2 < n) {
      b += sin(e * (m / n));
      e++;
    }
    cout << setprecision(9) << fixed << 1 + b * 2 << endl;
  }
  return 0;
}
