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