#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    float n;
    cin >> n;
    n = n * 2;
    std::cout << std::fixed;
    std::cout << std::setprecision(9);
    float side = tan((n - 2) * 1.57079632679489661923 / (n));
    cout << side << endl;
  }
  return 0;
}
