#include <bits/stdc++.h>
using namespace std;
signed main() {
  std::ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  ;
  long long CASE = 1;
  cin >> CASE;
  cout << fixed << setprecision(10);
  while (CASE--) {
    long long n;
    cin >> n;
    cout << 1 / tan(1.57079632679489661923 / n) << '\n';
  }
  return 0;
}
