#include <bits/stdc++.h>
using namespace std;
void solve() {
  double n;
  cin >> n;
  double angle = 360.0 / (2 * n);
  double rad = angle * 3.14159265 / 180.0;
  double value = (1.0 + cos(rad)) / (1.0 - cos(rad));
  double side = sqrt(value);
  cout << fixed << setprecision(6) << side << "\n";
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
