#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 7;
const long long inf = 0x3f3f3f3f;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    double pi = 3.1415926535897932384626433832795028841971, n;
    cin >> n;
    printf("%.10lf\n", 1 / tan(pi / (n * 2)));
  }
  return 0;
}
