#include <bits/stdc++.h>
using namespace std;
const long double pi = 2 * asin(1);
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    cout << setprecision(10) << (long double)(1) / tan(pi / (2 * n)) << endl;
  }
  return 0;
}
