#include <bits/stdc++.h>
#pragma comment(linker, "/stack:16777216")
using namespace std;
class Solution {
 public:
  void solve(std::istream& in, std::ostream& out) {
    int t;
    double n;
    in >> t;
    while (t--) {
      in >> n;
      out.precision(10);
      out << 1 / tan(1.57079632679489661923 / n) << endl;
    }
  }
};
void solve(std::istream& in, std::ostream& out) {
  out << std::setprecision(12);
  Solution solution;
  solution.solve(in, out);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  istream& in = cin;
  ostream& out = cout;
  solve(in, out);
  return 0;
}
