#include <bits/stdc++.h>
using namespace std;
int t, a, b, c, d;
char s[200001];
int main() {
  scanf("%d", &t);
  for (; t > 0; t--) {
    int n;
    scanf("%d", &n);
    printf("%.9lf\n", 1. / tan(3.14159265358979 / (2 * n)));
  }
}
