#include <bits/stdc++.h>
using namespace std;
const double PI = 2 * acos(0);
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(6);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    double a = 360.0 / (2.0 * n), b = (180.0 - a) / 2;
    double sa = sin(a * PI / 180.0), sb = sin(b * PI / 180.0);
    double s = (sb / sa), h = s * sb;
    cout << 2.0 * h << '\n';
  }
  return 0;
}
