#include <bits/stdc++.h>
using namespace std;
void file() {}
const long long nax = 2e5 + 1, mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  file();
  int testCases = 1;
  cin >> testCases;
  while (testCases--) {
    int sides;
    cin >> sides;
    sides *= 2;
    double angle = 360.0 / sides;
    angle /= 2;
    double inRadian = 3.14159265 * angle / 180.0;
    double geoTan = tan(inRadian);
    cout << fixed << setprecision(6) << 2.0 * 0.5 / geoTan << "\n";
  }
  return 0;
}
