#include <bits/stdc++.h>
using namespace std;
bool comp(pair<long long, char> aa, pair<long long, char> bb) {
  if (aa.first != bb.first) return aa.first > bb.first;
  return aa.second < bb.second;
}
bool comp1(pair<long long, char> aa, pair<long long, char> bb) {
  if (aa.first != bb.first) return aa.first < bb.first;
  return aa.second > bb.second;
}
bool comp2(pair<long long, long long> aa, pair<long long, long long> bb) {
  if (aa.first != bb.first) return aa.first > bb.first;
  return aa.second < bb.second;
}
bool comp3(pair<long long, long long> aa, pair<long long, long long> bb) {
  if (aa.first != bb.first) return aa.first < bb.first;
  return aa.second > bb.second;
}
long long rup(long long ik, long long ikk) {
  if (ik % ikk == 0)
    return ik / ikk;
  else
    return (ik / ikk) + 1;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
long long kop(long long n1) {
  long long x = 1;
  long long i;
  long long n = n1;
  set<long long> s1;
  unordered_map<long long, long long> m;
  long long pp = sqrt(n);
  for (i = 2; i <= pp; i = i + 1) {
    while (n % i == 0) {
      s1.insert(i);
      m[i] += 1;
      x *= i;
      n /= i;
    }
  }
  if (n > 1) {
    s1.insert(n);
    x *= n;
    m[n] += 1;
  }
  long long sum = 0;
  for (auto u : s1) {
    long long j;
    for (j = 1; j > -1; j++) {
      if ((j * (j + 1)) / 2 > m[u]) {
        sum += j - 1;
        break;
      }
    }
  }
  return sum;
}
long long ncr(long long n, long long r) {
  long long p = 1, k = 1;
  if (n - r < r) r = n - r;
  if (r != 0) {
    while (r) {
      p *= n;
      k *= r;
      long long m = gcd(p, k);
      p /= m;
      k /= m;
      n--;
      r--;
    }
  } else
    p = 1;
  return p;
}
bool prime(long long jh) {
  long long j;
  long long g = 0;
  for (j = 2; j <= sqrt(jh); j = j + 1) {
    if (jh % j == 0) {
      g++;
      break;
    }
  }
  if (g == 1)
    return false;
  else
    return true;
}
long long mary(long long k) {
  long long g1 = 0;
  long long xx = k;
  while (xx != 0) {
    g1++;
    xx /= 10;
  }
  return g1;
}
string multiply(string num1, string num2) {
  long long len1 = num1.size();
  long long len2 = num2.size();
  if (len1 == 0 || len2 == 0) return "0";
  vector<long long> result(len1 + len2, 0);
  int i_n1 = 0;
  int i_n2 = 0;
  for (long long i = len1 - 1; i >= 0; i--) {
    long long carry = 0;
    long long n1 = num1[i] - '0';
    i_n2 = 0;
    for (long long j = len2 - 1; j >= 0; j--) {
      int n2 = num2[j] - '0';
      long long sum = n1 * n2 + result[i_n1 + i_n2] + carry;
      carry = sum / 10;
      result[i_n1 + i_n2] = sum % 10;
      i_n2++;
    }
    if (carry > 0) result[i_n1 + i_n2] += carry;
    i_n1++;
  }
  long long i = result.size() - 1;
  while (i >= 0 && result[i] == 0) i--;
  if (i == -1) return "0";
  string s = "";
  while (i >= 0) s += std::to_string(result[i--]);
  return s;
}
string longDivision(string number, long long divisor) {
  string ans;
  long long idx = 0;
  long long temp = number[idx] - '0';
  while (temp < divisor) temp = temp * 10 + (number[++idx] - '0');
  while (number.size() > idx) {
    ans += (temp / divisor) + '0';
    temp = (temp % divisor) * 10 + number[++idx] - '0';
  }
  if (ans.length() == 0) return "0";
  return ans;
}
string findsum(string str1, string str2) {
  if (str1.length() > str2.length()) swap(str1, str2);
  string str = "";
  long long n1 = str1.length(), n2 = str2.length();
  reverse(str1.begin(), str1.end());
  reverse(str2.begin(), str2.end());
  long long carry = 0;
  for (long long i = 0; i < n1; i++) {
    long long sum = ((str1[i] - '0') + (str2[i] - '0') + carry);
    str.push_back(sum % 10 + '0');
    carry = sum / 10;
  }
  for (long long i = n1; i < n2; i++) {
    long long sum = ((str2[i] - '0') + carry);
    str.push_back(sum % 10 + '0');
    carry = sum / 10;
  }
  if (carry) str.push_back(carry + '0');
  reverse(str.begin(), str.end());
  return str;
}
bool khela(long long k1) {
  long long k = k1;
  long long pp = sqrt(k);
  if (pp * pp == k)
    return true;
  else
    return false;
}
long long nod(long long p1) {
  long long h;
  set<long long> s;
  for (h = 1; h <= sqrt(p1); h = h + 1) {
    if (p1 % h == 0) {
      s.insert(h);
      s.insert(p1 / h);
    }
  }
  long long yy = s.size();
  s.clear();
  return yy;
}
long double area(long long x1, long long y1, long long x2, long long y2,
                 long long x3, long long y3) {
  return abs((x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) / 2.0);
}
long long modpow(long long x, long long n, long long m) {
  if (n == 0) return 1 % m;
  long long u = modpow(x, n / 2, m);
  u = (u * u) % m;
  if (n % 2 == 1) u = (u * x) % m;
  return u;
}
long long inverse(long long x3, long long m3) { return modpow(x3, m3 - 2, m3); }
long long nm(long long a, long long b) { return (b + (a % b)) % b; }
vector<long long> adj[400005];
long long visited[400005];
long long dis[1000001] = {};
vector<long long> v;
void dfs(long long s) {
  if (visited[s]) return;
  visited[s] = 1;
  for (auto uu : adj[s]) {
    dfs(uu);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  cin >> t;
  while (t--) {
    long double n;
    cin >> n;
    n *= 2;
    long double jh = 3.141592654 / n;
    long double pp = 1 / tan(jh);
    printf("%.9Lf\n", pp);
  }
}
