#include <bits/stdc++.h>
using namespace std;
const double pi = 3.1415926535988;
const long long N = 1005;
int32_t main() {
  long long t, n;
  double ang, ans, temp;
  scanf("%lld", &t);
  while (t--) {
    scanf("%lld", &n);
    ang = (n - 1) * pi / n;
    temp = pi / 2;
    ans = 0.0;
    while (temp > 0.000001) {
      ans += cos(temp);
      temp += (ang - pi);
    }
    ans = (ans * 2.0) + 1;
    printf("%.9lf\n", ans);
  }
  return 0;
}
