The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $n$ is always even, and in C2, $n$ is always odd.

You are given a regular polygon with $2 \cdot n$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $1$. Let's name it as $2n$-gon.

Your task is to find the square of the minimum size such that you can embed $2n$-gon in the square. Embedding $2n$-gon in the square means that you need to place $2n$-gon in the square in such way that each point which lies inside or on a border of $2n$-gon should also lie inside or on a border of the square.

You can rotate $2n$-gon and/or the square.


-----Input-----

The first line contains a single integer $T$ ($1 \le T \le 200$) — the number of test cases.

Next $T$ lines contain descriptions of test cases — one per line. Each line contains single even integer $n$ ($2 \le n \le 200$). Don't forget you need to embed $2n$-gon, not an $n$-gon.


-----Output-----

Print $T$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $2n$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $10^{-6}$.


-----Example-----
Input
3
2
4
200

Output
1.000000000
2.414213562
127.321336469

Difficulty: MEDIUM
Tags: Geometry

Sorting

Mathematics
Skill types: Sorting

Starter code:

Solutions:
import math
t = int(input())
for _ in range(t):
	n = int(input())
	a = math.pi / (2 * n)
	print(1 / math.tan(a))


import sys
import math
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	l = math.sin((n - 1) * math.pi / (2 * n)) / math.sin(math.pi / (2 * n))
	print(l)


import math
for tst in range(int(input())):
	n = int(input())
	pi = 3.1415926535897
	p = 1 / n
	pp = 1 - p
	print(math.tan(pi * pp / 2))


import sys
import math
t = int(sys.stdin.readline())
for i in range(t):
	n = int(sys.stdin.readline())
	pi = math.pi
	theta = 0
	ans = 0
	while 2 * theta < pi:
		ans += math.cos(theta)
		theta += pi / n
	ans = 2 * ans - 1
	print(ans)


import sys
import math
import heapq

def ii():
	return sys.stdin.readline().strip()

def idata():
	return [int(x) for x in ii().split()]

def solve_of_problem():
	n = int(ii())
	print(1 / math.tan(math.pi / (2 * n)))
	return
for ______ in range(int(ii())):
	solve_of_problem()


import math
tests = int(input())
while tests > 0:
	n = 2 * int(input())
	interior = 360 / n
	degree = (180 - interior) / 2
	angle = math.radians(degree)
	h = math.tan(angle)
	h = round(math.tan(angle), 7)
	print(h)
	tests -= 1


import math
t = input('')
t = int(t)
i = 0
while i < t:
	i = i + 1
	n = input('')
	n = int(n)
	a = math.tan(math.pi / (2 * n))
	a = 1 / a
	print(a)


import math
ans = []
Q = int(input())
while Q > 0:
	Q -= 1
	n = 2 * int(input())
	alpha = 2 * math.pi / n
	l = math.sqrt(1 / (2 - 2 * math.cos(alpha)))
	area = 2 * l * l * math.sin(alpha)
	ans.append(str(area))
for i in ans:
	print(i)


import sys
import math
import heapq
import collections

def inputnum():
	return int(input())

def inputnums():
	return map(int, input().split())

def inputlist():
	return list(map(int, input().split()))

def inputstring():
	return [x for x in input()]
t = int(input())
for q in range(t):
	n = inputnum()
	angle = math.pi / (2 * n)
	ans = 1 / math.sin(angle)
	ans *= math.cos(angle / 2)
	print(ans)


import math
for ad in range(int(input())):
	n = int(input())
	n *= 2
	t = math.pi / n
	x = math.cos(t) / (2 * math.sin(t))
	print(2 * x)


import math
for _ in range(int(input())):
	n = int(input())
	n = 2 * n
	s = 1 / math.sin(math.pi / n)
	theta = math.pi / (2 * n)
	ans = s * math.cos(theta)
	print(round(ans, 10))


import math
for i in range(int(input())):
	n = int(input())
	tRi = 1 / math.tan(3.14159265 / (2 * n))
	print(tRi)


from math import *
for i in ' ' * int(input()):
	n = int(input())
	print(sin((2 * n - 1) * pi / (4 * n)) / sin(pi / (2 * n)))


import io, sys, atexit, os
import math as ma
from sys import exit
from decimal import Decimal as dec
from itertools import permutations
from itertools import combinations

def li():
	return list(map(int, sys.stdin.readline().split()))

def num():
	return map(int, sys.stdin.readline().split())

def nu():
	return int(input())

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	gg = find_gcd(x, y)
	return x * y // gg
mm = 1000000007

def solve():
	t = nu()
	for tt in range(t):
		n = nu()
		x = ma.pi / (2 * n)
		yy = ma.tan(x)
		print(1 / yy)
solve()


import math

def solve(n):
	ans = 1.0 / math.tan(math.pi / (2 * n))
	return ans

def read():
	t = int(input())
	for i in range(t):
		n = int(input())
		ans = solve(n)
		print(ans)
read()


import math
t = int(input())
for i in range(t):
	n = float(input())
	n = 2.0 * n
	a = (n - 2) * 180.0 / (2 * n)
	r = math.radians(a)
	print(round(1.0 * math.tan(r), 7))


from math import tan, pi
for _ in range(int(input())):
	n = int(input())
	u = 2 * n
	r = pi / u
	y = 1 / tan(r)
	print(y)


from math import cos, pi, sin
t = int(input())
for i in range(t):
	n = int(input())
	r = cos(pi / (2 * n)) / (2 * sin(pi / (2 * n)))
	R = 1 / (2 * sin(pi / (2 * n)))
	a = 2 * R * cos(pi / 4 - n // 2 * (pi / (2 * n)))
	print(a)


import math

def main():
	n = int(input())
	while n != 0:
		n -= 1
		x = int(input())
		print(1 / math.tan(math.pi / (2 * x)))
main()


import math
for num in range(int(input())):
	n = int(input())
	m = 2 * n
	print(m / (4 * math.tan(math.radians(180 / m))) / (n / 2))


from math import pi, tan
for _ in range(int(input())):
	n = int(input())
	print(1 / tan(pi / (2 * n)))


import math
t = int(input())
for i in range(t):
	n = int(input())
	a1 = 0.5 / math.sin(math.radians(90 / (2 * n)))
	print(a1)


import sys
from math import ceil, sqrt, sin, pi, tan
from collections import defaultdict
read = sys.stdin.buffer.readline
import heapq
mi = lambda : map(int, read().split())
li = lambda : list(mi())
cin = lambda : int(read())

def isp(n):
	i = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += 1
	return True
primes = []
no_of_chars = 256

def ps(sm):
	if sm < 0:
		return 1
	sq = int(sqrt(sm))
	if sq * sq == sm:
		return 0
	return 1
for _t in range(cin()):
	n = cin()
	n = 2 * n
	ans = 1 / (2 * tan(pi / n))
	print(2 * ans)


import math
a = int(input())
for i in range(0, a):
	n = int(input())
	print(1 / math.tan(math.pi / (2 * n)))


import math

def funk(n):
	sum = 0
	for i in range(1, int(n // 2) + 1):
		sum += math.sin(math.radians(i * 360 / n))
	return sum
count = int(input())
input_l = []
for i in range(count):
	tmp = input()
	input_l.append(int(tmp))
for i in input_l:
	print(funk(2 * i))


from math import tan, pi

def ntvdm():
	t = int(input())
	for _ in range(t):
		n = int(input())
		print(1 / tan(pi / 2 / n))
ntvdm()


import math
q = int(input())
for _ in range(q):
	n = int(input())
	n *= 2
	print(math.tan(math.pi / 2 - math.pi / n))


import math
t = int(input())
while t:
	t -= 1
	n = int(input())
	x = 1 / math.tan(math.pi / (2 * n))
	if n == 2:
		print('1.000000000')
	else:
		print('%.9f' % x)


from collections import Counter
from collections import defaultdict
from collections import deque
import math
import heapq
import sys
input = sys.stdin.readline
import bisect
rs = lambda : input().strip()
ri = lambda : int(input())
rl = lambda : list(map(int, input().split()))
rls = lambda : list(map(str, input().split()))
pi = math.pi
t = int(input())
for _ in range(0, t):
	n = ri()
	n = n - 1
	ans = 0.0
	a = pi / (n + 1)
	a1 = n * a
	y = pi / 2
	f = pow(10, 6)
	while y > 1 / f:
		ans = ans + math.cos(y)
		y = a1 + y - pi
	print(ans * 2 + 1)


import math
for ii in range(int(input())):
	n = int(input())
	print(math.cos(math.pi / (4 * n)) / math.sin(math.pi / (2 * n)))


import math
t = int(input())
for i in range(t):
	n = int(input())
	a = 0
	if n != 2:
		x = math.pi / n
		a += 1 / math.tan(x / 2)
		print('%.9f' % a)
	else:
		a = 1
		print('%.9f' % a)


import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys
T = int(input())
for t in range(T):
	n = int(input())
	theta = math.pi / (2.0 * n)
	r = 1.0 / (2.0 * math.sin(theta))
	max_x = 0
	for i in range(n):
		theta2 = math.pi / 4.0 + 2 * i * theta
		x = r * math.sin(theta2)
		max_x = max(max_x, abs(x))
	print('{:.20f}'.format(max_x * 2))


import queue
import math
t = int(input())
while t:
	n = int(input())
	if n == 2:
		print(1)
	else:
		y = n // 2 - 1
		alpha = (math.pi / 2 - math.pi / n) / y
		x = sum([math.cos(i * alpha) for i in range(1, y + 1)])
		print(1 + 2 * x)
	t -= 1


import math
t = int(input())
while t > 0:
	n = int(input())
	ans = 0.0
	if n % 2 == 1:
		ans = 1.0 / math.sin(math.pi / (2 * n))
	else:
		ans = 1.0 / math.tan(math.pi / (2 * n))
	print('%.10f' % ans)
	t -= 1


from math import sin, radians
for _ in range(int(input())):
	n = int(input())
	(ang, res, x) = (360 / (2 * n), 0, 0)
	for i in range(n - 1):
		x += ang
		res += sin(radians(x))
	print(f'{res:.9f}')


import math

def solve(e):
	return math.tan(math.pi * (e - 2) / (2 * e)) / 2
t = int(input())
while t > 0:
	n = int(input())
	print(solve(2 * n) * 2)
	t -= 1


import math
T = int(input())
for i in range(T):
	x = 2 * int(input())
	print(1 / math.tan(math.pi / x))


import math
t = int(input())
for i in range(t):
	n = int(input())
	sum = 0.0
	ang = 90.0 / (n / 2)
	ang1 = ang
	for i in range(n // 2 - 1):
		sum += math.sin(ang1 * (math.pi / 180.0))
		ang1 += ang
	ans = 1.0 + 2.0 * sum
	print(ans)


import math
import sys

def input():
	return sys.stdin.readline().rstrip()
t = int(input())
answers = []
for i in range(t):
	k = int(input())
	n = 2 * k
	(x, y) = (0, 0)
	to_do = int((n - 2) / 2)
	theta = math.pi - (n - 2) * math.pi / n
	for i in range(1, to_do + 1):
		x += math.cos(i * theta)
		y += math.sin(i * theta)
	ans = math.sqrt(x ** 2 + y ** 2)
	answers.append(ans)
print(*answers, sep='\n')


import sys
import math
input = sys.stdin.readline
flush = sys.stdout.flush
for _ in range(int(input())):
	n = int(input())
	print(1.0 / math.tan(math.pi / (2.0 * n)))


import math
for _ in range(int(input())):
	n = int(input())
	n = 2 * n
	ans = 1 / math.tan(math.pi / n)
	print('%0.9f' % ans)


import math
pi = 3.14159265359
t = int(input(''))
for i in range(t):
	n = int(input(''))
	print(1 / math.tan(pi / (2 * n)))


import math
t = int(input())
for i in range(t):
	n = int(input())
	m1 = math.sin(2 * math.pi / 360 * (45 * (2 * n - 2) / n))
	m2 = 2 * math.sin(2 * math.pi / 360 * (90 / n))
	x = 2 * m1 / m2
	print('%.9f' % x)


from math import *
pi = 3.14159265359
for _ in range(int(input())):
	n = int(input())
	if n == 2:
		print('%.8f' % 1.0)
	else:
		x = pi / (2 * n)
		x = tan(x)
		print(1 / x)


from math import *
ans = []
for i in range(int(input())):
	n = int(input())
	ang = (n - 1) * pi / n
	s = 0
	for nn in range(n):
		s += abs(cos(-pi / 2 + nn * ang))
	ans += [s]
for an in ans:
	print(an)


import math
import sys
input = sys.stdin.readline
Q = int(input())
Query = [int(input()) for _ in range(Q)]
for N in Query:
	if N % 2 == 0:
		print(1 / math.tan(math.pi / (N * 2)))


import math
T = int(input())
for tc in range(T):
	n = int(input())
	sides = 2 * n
	x = math.tan(math.radians(180 / sides))
	ans = 1 / (2 * x)
	print(2 * ans)


import math
t = int(input())
cnt = 0
while cnt < t:
	cnt += 1
	n = int(input())
	res = 1 / math.sin(math.pi / (2 * n)) * math.cos(math.pi / (2 * n))
	print(res)


from sys import stdin, stdout
from math import pi, sin, cos

def cal(n, angle, r):
	ang = 180.0 / n
	res = 0
	for i in range(n):
		res = max(res, abs(sin(angle * pi / 180.0)) * r)
		res = max(res, abs(cos(angle * pi / 180.0)) * r)
		angle += ang
	return res
for _ in range(int(input())):
	n = int(input())
	angle = 180.0 / n
	rd = 0.5 / sin(angle / 2.0 * pi / 180.0)
	(l, r) = (0, angle)
	cnt = 100
	while cnt:
		cnt -= 1
		(m1, m2) = ((l + l + r) / 3.0, (l + r + r) / 3.0)
		(t1, t2) = (cal(n, m1, rd), cal(n, m2, rd))
		if t1 < t2:
			r = m2
		else:
			l = m1
	ans = cal(n, l, rd)
	print('{:.9f}'.format(ans * 2.0))


from math import tan, pi

def main():
	t = int(input())
	for __ in range(t):
		n = int(input())
		print(2 * (0.5 / tan(pi / (2 * n))))
main()


from math import *
t = int(input())
for i in range(t):
	n = int(input())
	ans = cos(pi / (4 * n)) / sin(pi / (2 * n))
	print('%.9f' % ans)


import os
import sys
from io import BytesIO, IOBase

def iin():
	return int(input())

def lin():
	return list(map(int, input().split()))

def main():
	from math import sin, pi, tan, acos, cos
	T = iin()
	for _ in range(T):
		n = iin()
		n1 = 2 * n
		theta = pi / n
		h = cos(theta / 4) / sin(theta / 2)
		print(h)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from math import sin, radians, sqrt
for _ in range(int(input())):
	n = int(input())
	angle = radians(180 / n)
	r = 2 * (0.5 / sin(angle / 2))
	print(sqrt(r ** 2 - 1))


import math
for _ in range(int(input())):
	n = int(input())
	n = n * 2.0
	ans = 1.0 / math.sin(math.pi / (2.0 * n))
	print(ans / 2)


import math
for _ in range(int(input())):
	n = int(input())
	x = 1 / math.tan(math.pi / (n * 2))
	print(round(x, 9))


import math
import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	theta = 2 * n
	print(1 / math.tan(math.radians(360 / 4 / n)))


import math
t = int(input())
for _ in range(t):
	n = int(input())
	n = 2 * n
	a = math.pi / n
	radius = 1 / (2 * math.sin(a))
	ans = 2 * radius * math.cos(a)
	print(ans)


t = int(input())
import math
for _ in range(t):
	s = float(input())
	a = math.pi / (2.0 * s)
	p = min(1 / math.tan(a), 1 / math.sin(a))
	print(p)


from typing import List
from math import tan, pi
INF = float('inf')
NINF = float('-inf')

def read_string():
	return input()

def read_string_line():
	return [x for x in input().split(' ')]

def read_int_line():
	return [int(x) for x in input().split(' ')]

def read_int():
	return int(input())

def get_int_arr(s):
	return [int(x) for x in s.split()]

def get_sum(acc, l, r):
	return acc[r] - acc[l]
P = int(1000000000.0 + 7)

def exgcd(x, y):
	if y == 0:
		return (x, 1, 0)
	(g, a, b) = exgcd(y, x % y)
	t = x // y
	return (g, b, a - t * b)

def inv(x):
	(g, a, b) = exgcd(x, P)
	return a

def calc_acc(arr):
	ans = [0]
	for a in arr:
		ans.append(a + ans[-1])
	return ans

class Point:

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def __sub__(self, other):
		return Point(self.x - other.x, self.y - other.y)

	def dot(self, other):
		return self.x * other.x + self.y * other.y

	def cross(self, other):
		return self.x * other.y - self.y * other.x

	def abs(self):
		return self.abs2() ** 0.5

	def abs2(self):
		return self.dot(self)

	def __str__(self):
		return 'Point(%s, %s)' % (self.x, self.y)

def get_point(line):
	(x, y) = get_int_arr(line)
	return Point(x, y)
lines: List[str] = [*open(0)]
n = int(lines[0])
for line in lines[1:1 + n]:
	k = int(line)
	print(1 / tan(pi / (2 * k)))


import math
t = int(input())
for _ in range(t):
	n = int(input())
	print('{:.10f}'.format(math.cos(math.pi / (4 * n)) / math.sin(math.pi / (2 * n))))


import math
t = int(input())
for _ in range(t):
	n = int(input())
	sides = 2 * n
	interiorAngle = (sides - 2) * 180 / sides
	centreAngle = 180 - interiorAngle
	reqdAngle = centreAngle * (sides // 4 + 1) / 2
	radius = math.sin(math.radians(interiorAngle / 2)) / math.sin(math.radians(centreAngle))
	x = math.sqrt(2) * radius * math.sin(math.radians(reqdAngle)) - 1
	print(1 + 2 * x)


import math as m

def fu(a):
	return a / 180 * m.pi
t = int(input())
for _ in range(t):
	n = int(input())
	a = n // 2 - 1
	b = 180 - 360 / (2 * n)
	s = 0
	for i in range(1, a + 1):
		s = s + m.cos(fu(i * b - (2 * i - 1) * 90))
	print(2 * s + 1)


MOD = 10 ** 9 + 7
RLIMIT = 1000
DEBUG = 1

def main():
	for _ in inputt():
		(n,) = inputi()
		d = 2 * pi / (n * 2)
		s = 0
		for i in range(1, 2 * n + 1):
			if sin(i * d + pi / 4) > 0:
				s += sin(i * d + pi / 4)
		print(s)
from math import *
from heapq import *
from itertools import *
from functools import reduce, lru_cache, partial
from collections import Counter, defaultdict, deque
import re, copy, operator, cmath
import sys, io, os, builtins
sys.setrecursionlimit(RLIMIT)
BUFSIZE = 8192

class FastIO(io.IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = io.BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(io.IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	if args:
		sys.stdout.write(str(args[0]))
		split = kwargs.pop('split', ' ')
		for arg in args[1:]:
			sys.stdout.write(split)
			sys.stdout.write(str(arg))
	sys.stdout.write(kwargs.pop('end', '\n'))

def debug(*args, **kwargs):
	if DEBUG and (not __debug__):
		print('debug', *args, **kwargs)
		sys.stdout.flush()
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip()
inputt = lambda t=0: range(t) if t else range(int(input()))
inputs = lambda : input().split()
inputi = lambda k=int: map(k, inputs())
inputl = lambda t=0, k=lambda : list(inputi()): [k() for _ in range(t)] if t else list(k())

def len(a):
	if isinstance(a, range):
		return -((a.start - a.stop) // a.step)
	return builtins.len(a)

def bisect_left(a, x, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	if key == None:
		key = do_nothing
	while lo < hi:
		mid = (lo + hi) // 2
		if key(a[mid]) < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def bisect_right(a, x, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	if key == None:
		key = do_nothing
	while lo < hi:
		mid = (lo + hi) // 2
		if x < key(a[mid]):
			hi = mid
		else:
			lo = mid + 1
	return lo

def insort_left(a, x, key=None, lo=0, hi=None):
	lo = bisect_left(a, x, key, lo, hi)
	a.insert(lo, x)

def insort_right(a, x, key=None, lo=0, hi=None):
	lo = bisect_right(a, x, key, lo, hi)
	a.insert(lo, x)
do_nothing = lambda x: x
bisect = bisect_right
insort = insort_right

def index(a, x, default=None, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	if key == None:
		key = do_nothing
	i = bisect_left(a, x, key, lo, hi)
	if lo <= i < hi and key(a[i]) == x:
		return a[i]
	if default != None:
		return default
	raise ValueError

def find_lt(a, x, default=None, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	i = bisect_left(a, x, key, lo, hi)
	if lo < i <= hi:
		return a[i - 1]
	if default != None:
		return default
	raise ValueError

def find_le(a, x, default=None, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	i = bisect_right(a, x, key, lo, hi)
	if lo < i <= hi:
		return a[i - 1]
	if default != None:
		return default
	raise ValueError

def find_gt(a, x, default=None, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	i = bisect_right(a, x, key, lo, hi)
	if lo <= i < hi:
		return a[i]
	if default != None:
		return default
	raise ValueError

def find_ge(a, x, default=None, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	i = bisect_left(a, x, key, lo, hi)
	if lo <= i < hi:
		return a[i]
	if default != None:
		return default
	raise ValueError

class Tree:

	def __init__(n):
		self._n = n
		self._conn = [[] for _ in range(n)]
		self._list = [0] * n

	def connect(a, b):
		pass

class Sieve:

	def __init__(self):
		self._n = 6
		self._list = [2, 3, 5, 7, 11, 13]

	def extend(self, n):
		if n <= self._list[-1]:
			return
		maxbase = int(n ** 0.5) + 1
		self.extend(maxbase)
		begin = self._list[-1] + 1
		newsieve = [i for i in range(begin, n + 1)]
		for p in self.primerange(2, maxbase):
			for i in range(-begin % p, len(newsieve), p):
				newsieve[i] = 0
		self._list.extend([x for x in newsieve if x])

	def extend_to_no(self, i):
		while len(self._list) < i:
			self.extend(int(self._list[-1] * 1.5))

	def primerange(self, a, b):
		a = max(2, a)
		if a >= b:
			return
		self.extend(b)
		i = self.search(a)[1]
		maxi = len(self._list) + 1
		while i < maxi:
			p = self._list[i - 1]
			if p < b:
				yield p
				i += 1
			else:
				return

	def search(self, n):
		if n < 2:
			raise ValueError
		if n > self._list[-1]:
			self.extend(n)
		b = bisect(self._list, n)
		if self._list[b - 1] == n:
			return (b, b)
		else:
			return (b, b + 1)

	def __contains__(self, n):
		if n < 2:
			raise ValueError
		if not n % 2:
			return n == 2
		(a, b) = self.search(n)
		return a == b

	def __getitem__(self, n):
		if isinstance(n, slice):
			if n.stop:
				self.extend_to_no(n.stop + 1)
				return self._list[n.start:n.stop:n.step]
			return islice(self, n.start, n.stop, n.step)
		else:
			self.extend_to_no(n + 1)
			return self._list[n]
sieve = Sieve()

def isprime(n):
	if n <= sieve._list[-1]:
		return n in sieve
	for i in sieve:
		if not n % i:
			return False
		if n < i * i:
			return True
prime = sieve.__getitem__
primerange = lambda a, b=0: sieve.primerange(a, b) if b else sieve.primerange(2, a)

def factorint(n):
	factors = []
	for i in sieve:
		if n < i * i:
			break
		while not n % i:
			factors.append(i)
			n //= i
	if n != 1:
		factors.append(n)
	return factors
factordict = lambda n: Counter(factorint(n))
main()


t = int(input())
from math import tan
from math import pi
for tt in range(t):
	n = int(input())
	print(1 / tan(pi / (n + n)))


import math
t = int(input())
for i in range(t):
	n = int(input())
	print(math.cos(math.pi / 4 / n) / math.sin(math.pi / 2 / n))


import math

def InscribedCircleArea(n, a):
	if a < 0 and n < 0:
		return -1
	r = a / math.tan(180 / n * 3.141592653589793 / 180)
	return r
t = int(input())
a = 1
while t > 0:
	t -= 1
	n = int(input())
	n *= 2
	print(round(InscribedCircleArea(n, a), 20))


from sys import stdin, stdout
import math
from collections import defaultdict, Counter
import heapq
import os
import sys
from io import BytesIO, IOBase

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		X = math.pi / (2 * n)
		print(math.cos(X / 2) / math.sin(X))
main()


import math
for _ in range(int(input())):
	n = int(input())
	r = 1 / (2 * math.tan(360 / (2 * 2 * n) * (math.pi / 180)))
	R = 1 / (2 * math.sin(360 / (2 * 2 * n) * (math.pi / 180)))
	print(r * 2)


import math
t = int(input())
for i1 in range(t):
	n = int(input())
	if n % 2 == 0:
		theta = 1 / n * math.pi
		print(1 / math.tan(theta / 2))


import math

def solve():
	n = int(input())
	radperseg = math.pi / 180 * 360 / 2 / n
	l = 0
	r = math.pi / 2 - radperseg
	prev = -1
	ans = 0
	while l < r:
		ans = (l + r) / 2
		fr = math.sin(radperseg * (n - 1) / 2 + r) - math.cos(r)
		fm = math.sin(radperseg * (n - 1) / 2 + ans) - math.cos(ans)
		if fm * fr > 0:
			r = ans
		else:
			l = ans
		if abs(fm - prev) < 1e-09:
			break
		prev = fm
	print(2 * math.sqrt(1 / (2 * (1 - math.cos(radperseg)))) * math.cos(ans))
for i in range(int(input())):
	solve()


import math
t = int(input())
for _ in range(t):
	n = int(input())
	ans = 0
	for i in range(n):
		ans += math.cos(math.radians(180 / n * i - 90))
	print(ans)


import math

def solve():
	n = int(input())
	n = 2 * n
	a1 = 360 / n
	a = a1 / 2
	a = math.radians(a)
	a = math.tan(a)
	x = 1 / a
	print('%.9f' % x)
for _ in range(int(input())):
	solve()


from sys import stdin, stdout
import math
from collections import Counter, deque
L = lambda : list(map(int, stdin.readline().strip().split()))
M = lambda : map(int, stdin.readline().strip().split())
I = lambda : int(stdin.readline().strip())
IN = lambda : stdin.readline().strip()
C = lambda : stdin.readline().strip().split()
mod = 1000000007

def s(a):
	print(' '.join(list(map(str, a))))
for _ in range(I()):
	n = I()
	x = 0
	deg = 3.1415926535 / 180
	k = 360 / (2 * n)
	for i in range(int((n - 1) // 2)):
		x += math.cos(deg * (i + 1) * k)
	print('%0.9f' % (1 + 2 * x))


import math
t = int(input())
for _ in range(t):
	n = int(input())
	z = 2 * n
	a = math.cos(math.pi / z)
	b = math.sin(math.pi / z)
	print(a / b)


import math
t = int(input())
for _ in range(t):
	n = int(input())
	ans = 0
	angle = math.radians(360 / (n * 4))
	print(math.tan(angle) ** (-1))


t = int(input())
for i in range(t):
	import math
	n = int(input())
	r = math.tan(math.pi / (2 * n))
	print('%.6f' % (1 / r))


import math
test = int(input())
for i in range(test):
	n = int(input())
	n = 2 * n
	tan_ = math.tan(math.pi / n)
	a = 1 / tan_
	print('%.9f' % a)


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
import sys
from math import sin, tan, pi

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		n *= 2
		k = (n + 7) // 8 - 1
		s = pi / 4 - k * 2 * pi / n
		x = 1 / (2 * sin(pi / n))
		c = 2 * pi / n * (k + 1 / 2)
		b = (n - 2) * pi / (2 * n) + s
		a = pi - b - c
		y = x * sin(b) / sin(a)
		ans = y * 2 ** 0.5
		sys.stdout.write(str(ans) + '\n')
main()


ans = {3: 1.931851652578137, 5: 3.1962266107498305, 7: 4.465702135190254, 9: 5.736856622834928, 11: 7.00877102284205, 13: 8.281093789118495, 15: 9.553661304648701, 17: 10.826387080174316, 19: 12.099221090606225, 21: 13.372132387773904, 23: 14.64510079714694, 25: 15.918112604548812, 27: 17.191158161652254, 29: 18.464230483075124, 31: 19.737324386897843, 33: 21.010435947900465, 35: 22.283562138356153, 37: 23.556700585376017, 39: 24.829849402946724, 41: 26.10300707314532, 43: 27.376172360514047, 45: 28.649344249275092, 47: 29.922521896579926, 49: 31.195704597210476, 51: 32.46889175658776, 53: 33.742082869893075, 55: 35.015277505745324, 57: 36.28847529331536, 59: 37.561675912061524, 61: 38.8348790834848, 63: 40.10808456445453, 65: 41.38129214176658, 67: 42.65450162767617, 69: 43.927712856207805, 71: 45.20092568008886, 73: 46.47413996818731, 75: 47.747355603359544, 77: 49.02057248063344, 79: 50.29379050566765, 81: 51.56700959343902, 83: 52.84022966711982, 85: 54.1134506571136, 87: 55.386672500223845, 89: 56.659895138934914, 91: 57.93311852078775, 93: 59.20634259783608, 95: 60.47956732617132, 97: 61.75279266550647, 99: 63.026018578810074, 101: 64.29924503198401, 103: 65.57247199357865, 105: 66.84569943454059, 107: 68.11892732798874, 109: 69.39215564901495, 111: 70.66538437450639, 113: 71.93861348298648, 115: 73.21184295447279, 117: 74.4850727703492, 119: 75.75830291325114, 121: 77.03153336696215, 123: 78.3047641163205, 125: 79.57799514713487, 127: 80.85122644610789, 129: 82.12445800076682, 131: 83.39768979940062, 133: 84.67092183100281, 135: 85.94415408521901, 137: 87.21738655229956, 139: 88.49061922305593, 141: 89.76385208882093, 143: 91.0370851414123, 145: 92.31031837309914, 147: 93.58355177657134, 149: 94.85678534491129, 151: 96.13001907156787, 153: 97.40325295033253, 155: 98.67648697531708, 157: 99.94972114093346, 159: 101.22295544187476, 161: 102.49618987309775, 163: 103.76942442980673, 165: 105.04265910743855, 167: 106.31589390164861, 169: 107.58912880829797, 171: 108.8623638234414, 173: 110.13559894331603, 175: 111.40883416433105, 177: 112.68206948305792, 179: 113.95530489622139, 181: 115.22854040069092, 183: 116.50177599347283, 185: 117.77501167170294, 187: 119.04824743263957, 189: 120.32148327365705, 191: 121.5947191922398, 193: 122.86795518597636, 195: 124.14119125255439, 197: 125.41442738975526, 199: 126.68766359544964}
T = int(input())
for t in range(T):
	n = int(input())
	print(ans[n])


import math
t = int(input())
for i in range(t):
	n = int(input())
	a = math.sin(math.radians(45 / n))
	print(1 / (2 * a))


from math import pi, tan
T = int(input())
for _ in range(T):
	n = int(input())
	print(1.0 / tan(0.5 * pi / n))


from math import sin, sqrt, pi
t = int(input())
for i in range(t):
	x = int(input())
	x *= 2
	print(sqrt((1 / sin(pi / x)) ** 2 - 1))


from sys import stdin
from math import cos, sin, radians
import math
inp = lambda : stdin.readline().strip()

def diagonal(x):
	return 1 / sin(radians(180 / x))
t = int(inp())
for _ in range(t):
	n = int(inp())
	f = (diagonal(2 * n) ** 2 - 1) ** (1 / 2)
	print(f)


from sys import stdin, stdout
import collections
import heapq
import itertools
import functools
import math

def read_line():
	return stdin.readline().strip()

def read_int():
	return int(read_line())

def read_arr():
	return read_line().split(' ')

def read_int_arr():
	return [int(x) for x in read_arr()]

def query_interactive(s):
	print(s)
	stdout.flush()

def main():
	T = read_int()
	for _ in range(T):
		N = read_int() * 2
		apothem = 1 / math.tan(math.pi / N)
		print(apothem)
main()


from sys import stdin, stdout
input = stdin.readline
from math import radians, sin, cos, sqrt
for _ in range(int(input())):
	n = int(input()) * 2
	r = 1 / (2 * sin(radians(360 / (2 * n))))
	print('{:.8f}'.format(2 * sqrt(r * r - 0.5 * 0.5)))


import math as mt
t = int(input())
for i in range(t):
	n = int(input())
	ans = 1
	ld = 1 / (2 * mt.sin(mt.pi / 180 * (90 / (2 * n))))
	print(ld)


t = int(input())
from math import *
for x in range(t):
	q = int(input())
	print(cos(pi / (2 * q)) / sin(pi / (2 * q)))


mod = 1000000007
eps = 10 ** (-9)

def main():
	import sys
	from math import sin, pi, cos
	input = sys.stdin.readline
	for _ in range(int(input())):
		N = int(input())
		NN = N * 2
		print(cos(pi / NN) / sin(pi / NN))
main()


import math
t = int(input())
for _ in range(t):
	n = int(input())
	a = 2 * (1 / math.sin(math.pi / n) * math.sin(math.pi * (n - 1) / (2 * n)))
	ans = 10 ** 18
	l = 0
	r = math.pi / (2 * n)
	for _ in range(100):
		theta1 = (2 * l + r) / 3
		theta2 = (l + 2 * r) / 3
		tmp1 = max(a * math.cos(theta1), a * math.sin(math.pi * (n - 1) / (2 * n) + theta1))
		tmp2 = max(a * math.cos(theta2), a * math.sin(math.pi * (n - 1) / (2 * n) + theta2))
		if tmp1 > tmp2:
			l = theta1
		else:
			r = theta2
	print(a * math.cos(r))


from math import tan, radians
for _ in range(int(input())):
	n = int(input())
	n *= 2
	r = 1 / tan(radians(180 / n))
	print('%.6f' % r)


import math
t = int(input())
for _ in range(t):
	n = int(input())
	n *= 2
	ans = math.cos(math.pi / (2 * n)) / math.sin(math.pi / n)
	print('{:.9f}'.format(ans))


from pprint import pprint
import sys
q = int(input())
import math
for _ in range(q):
	on = int(input())
	n = on * 2
	a = 1
	m = on - 1
	v1 = a * math.sin(m * math.pi / n) / math.sin(math.pi / n)
	print(v1)


import math as mt
for _ in range(int(input())):
	n = int(input())
	theta = 180 * (2 * n - 2) / (4 * n)
	l = 1 / (2 * mt.cos(theta * mt.pi / 180))
	theta2 = (90 - theta) / 2
	print(2 * l * mt.cos(theta2 * mt.pi / 180))


import math
inp = int(input())
seq = []
for i in range(inp, 0, -1):
	n = int(input())
	seq.append(0.5 / math.sin(math.asin(1) / (n * 2)))
for i in seq:
	print(i)


import math
t = int(input())
for _ in range(t):
	n = int(input())
	n = 2 * n
	print(math.tan(3.141592653589793 / n) ** (-1))


from math import tan, pi
import sys
input = sys.stdin.readline
for _ in range(int(input())):
	x = int(input())
	ans = 1 / tan(pi / (2 * x))
	print(ans)


import math
t = int(input())
while t:
	n = int(input())
	ans = 1 / math.tan(math.radians(180) / (2 * n))
	print(ans)
	t -= 1


from sys import stdin, stdout
import math
from collections import defaultdict, Counter
import heapq
import os
import sys
from io import BytesIO, IOBase

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		X = math.pi / (2 * n)
		print(math.cos(X / 2) / math.sin(X))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import math
t = int(input())
for _ in range(t):
	n = int(input())
	th = 360 / (2 * n)
	th = th * (math.pi / 180)
	cs = math.cos(th)
	ans = math.sqrt((1 + cs) / (1 - cs))
	print(ans)


t = int(input())
import math
for _ in range(t):
	n = int(input())
	ang = 360 / (2 * n)
	if n % 2 == 0:
		ang1 = ang / 2
		a = 0.5 / math.tan(math.radians(ang1))
		print(2 * a)
	else:
		ang1 = ang / 2
		a = 0.5 / math.tan(math.radians(ang1))
		b = 0.5 * math.asin(math.radians(ang1))
		print(max(2 * a, 2 * b))


import math
for _ in range(int(input())):
	n = int(input())
	alpha = 180 / n
	pi = math.pi
	ans = math.cos(pi / (4 * n)) / math.sin(pi / (2 * n))
	print(ans)


import math

def read_int():
	return int(input().strip())

def read_ints():
	return list(map(int, input().strip().split(' ')))

def solve():
	n = 2 * read_int()
	return 1 / math.tan(math.pi / n)
T = read_int()
for _ in range(T):
	print(solve())


import math

def task(n):
	angles = (2 * n - 2) * 180
	angle = angles / (2 * n) / 2
	radians = math.radians(angle)
	if n % 2 == 1:
		x = 0.5 / math.cos(radians)
	else:
		x = math.tan(radians)
	print('{:.9f}'.format(round(x, 9)))
t = int(input())
for i in range(0, t):
	n = int(input())
	task(n)


import sys
import math
fileoperation = 0
if fileoperation:
	orig_stdout = sys.stdout
	orig_stdin = sys.stdin
	inputfile = open('W:/Competitive Programming/input.txt', 'r')
	outputfile = open('W:/Competitive Programming/output.txt', 'w')
	sys.stdin = inputfile
	sys.stdout = outputfile
mod = 1000000007

def nospace(l):
	ans = ''.join((str(i) for i in l))
	return ans
t = int(input())
for tt in range(t):
	n = int(input())
	v = math.cos(math.pi / n)
	v = 1 - v
	v = 1 / v
	v /= 2
	v = pow(v, 0.5)
	cc = math.cos((n - 1) * math.pi / n)
	xx = (1 - cc) * (2 * v * v)
	xx = pow(xx, 0.5)
	print(xx)
if fileoperation:
	sys.stdout = orig_stdout
	sys.stdin = orig_stdin
	inputfile.close()
	outputfile.close()


import math
from sys import stdin, stdout
from heapq import heapify, heappop, heappush
from collections import Counter
T = int(stdin.readline())
for i in range(T):
	N = int(stdin.readline())
	ang = (N - 1) * 180 / (2 * N)
	ans = math.tan(ang * math.pi / 180)
	print(ans)


import sys
sys.setrecursionlimit(10000)
from math import tan, radians, sqrt, sin, pi, cos

class Memoize:

	def __init__(self, f):
		self.f = f
		self.memo = {}

	def __call__(self, *args):
		if not args in self.memo:
			self.memo[args] = self.f(*args)
		return self.memo[args]

class Recurse(Exception):

	def __init__(self, *args, **kwargs):
		self.args = args
		self.kwargs = kwargs

def recurse(*args, **kwargs):
	raise Recurse(*args, **kwargs)

def tail_recursive(f):

	def decorated(*args, **kwargs):
		while True:
			try:
				return f(*args, **kwargs)
			except Recurse as r:
				args = r.args
				kwargs = r.kwargs
				continue
	return decorated
t = int(input())
for _ in range(t):
	n = int(input())
	ans = cos(pi / (4 * n)) / sin(pi / (2 * n))
	print('%.6f' % ans)


from math import tan, radians
t = int(input())
for _ in range(t):
	n = int(input())
	theta1 = 180 / n
	theta2 = (180 - theta1) / 2
	print(tan(radians(theta2)))


import math
t = int(input())
for i in range(t):
	n = int(input())
	if n == 2:
		print(1)
		continue
	r = (n - 1) / (2 * n)
	h = math.tan(r * math.pi)
	print(h)


from math import pi, sin, sqrt
t = int(input())
for _ in range(t):
	n = int(input())
	al = pi / (2 * n)
	d = 0.5 / sin(al)
	print(sqrt(4 * d * d - 1))


import math
for _ in range(int(input())):
	n = int(input())
	n = 2 * n
	t = math.sin(math.pi / (2 * n))
	print(1 / (2 * t))


import math
import sys

def to_deg(rad):
	return rad / math.pi * 180

def input():
	return sys.stdin.readline().rstrip()
t = int(input())
answers = []
for i in range(t):
	k = int(input())
	n = 2 * k
	(x, y) = (0, 0)
	to_do = int(n / 4)
	theta = math.pi - (n - 2) * math.pi / n
	for i in range(1, to_do + 1):
		x += math.cos(i * theta)
		y += math.sin(i * theta)
	ans1 = math.sqrt(x ** 2 + y ** 2)
	(x, y) = (0, 0)
	to_do = int(n / 2) - int(n / 4)
	for i in range(1, to_do + 1):
		x += math.cos(i * theta)
		y += math.sin(i * theta)
	ans2 = math.sqrt(x ** 2 + y ** 2)
	ans = math.cos(math.pi / 4) * (ans1 + ans2)
	answers.append(ans)
print(*answers, sep='\n')


import math

def square(n):
	n *= 2
	return n * pow(1, 2) / 4 * 1 / math.tan(math.pi / n)
t = int(input())
for _ in range(t):
	n = int(input())
	res = square(n) / (n / 2)
	print(res)


from math import *
t = int(input())
for _ in range(t):
	n = int(input())
	ans = 1 / tan(pi / 2 / n)
	print(f'{ans:.9f}')


from itertools import accumulate, groupby
import math
for _ in range(int(input())):
	n = int(input())
	n = 2 * n
	a = math.pi / (2 * n)
	print(round(math.tan((n - 2) * a), 7))


from math import sin, pi, cos

def solve():
	n = int(input())
	return cos(pi / (4 * n)) / sin(pi / (2 * n))

def main():
	t = int(input())
	print('\n'.join(map(str, [solve() for _ in range(t)])))
main()


import math
for _ in range(int(input())):
	N = 2 * int(input())
	apo = 1.0 / 2 / math.tan(math.pi / N)
	print(2 * apo)


import math
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 != 0:
		print(1 / math.sin(math.pi / 2 / n))
	else:
		print(1 / math.tan(math.pi / 2 / n))


import math
t = int(input())
for i in range(t):
	n = 2 * int(input())
	ang = (n - 2) * 180 / n
	ang = math.radians(ang)
	h = math.tan(ang / 2)
	print(h)


import math
import decimal
decimal.getcontext().prec = 15
t = int(input())
for i in range(t):
	n = int(input())
	print(1 / math.tan(math.pi / (2 * n)))


from math import tan, radians
for _ in range(int(input())):
	n = 2 * int(input())
	apot = 0.5 * tan(radians((90 * n - 180) / n))
	diag = (0.25 + apot ** 2) ** 0.5
	if n % 4:
		print(diag * 2)
	else:
		print(apot * 2)


from math import *
t = int(input())
for case in range(t):
	n = int(input())
	print(1 / tan(pi / (2 * n)))


import sys
input = sys.stdin.buffer.readline
from math import *
t = int(input())
for _ in range(t):
	n = 2 * int(input())
	R = 1 / (2 * sin(pi / n))
	theta0 = 2 * pi / n
	maxi = 0
	theta = 0
	for i in range(n // 2 + 1):
		x = 2 * R * sin(theta / 2)
		y = 2 * R * cos(theta / 2)
		num = (x + y) / sqrt(2)
		maxi = max(num, maxi)
		theta += theta0
	print(round(maxi, 10))


import math
pi = 3.141592653589793
t = int(input())
for ii in range(t):
	n = int(input()) * 2
	if n % 4 != 0:
		print(1 / math.sin(pi / n))
	else:
		print(math.sqrt(1 / math.sin(pi / n) * (1 / math.sin(pi / n)) - 1))


from math import *
t = int(input())
for _ in range(t):
	n = int(input())
	angle = 360 / (2 * n)
	side = 1
	count = 0
	d = angle
	while angle <= 90:
		count += 1
		side += 2 * cos(radians(angle))
		angle += d
	print(side)


t = int(input())
from math import pi, sin, cos
for i in range(t):
	n = int(input())
	angle = (2 * n - 2) * pi / (2 * n)
	l = [angle / 2]
	a = angle / 2
	k = n // 2
	for j in range(n // 2 - 1):
		l.append(angle - pi + a)
		a = l[-1]
		if pi / 2 - l[-1] <= pi / 4:
			k = len(l) + 1
	(s1, s2, s3) = (0, 0, 0)
	for j in range(max(1, k - 1)):
		s1 += sin(l[j])
	for j in range(max(1, k - 1), n // 2):
		s2 += 2 * cos(l[j])
		s3 += cos(l[j])
	a = 1 + s2 + 2 * s1
	s3 += 0.5
	b = a / 2 ** 0.5
	print(b)


import math
t = int(input())
for test in range(t):
	n = int(input())
	n = 2 * n
	pi = 3.141592653589793
	degree = float(180 / n)
	radian = degree * (pi / 180)
	ap = 1 / (2 * math.tan(radian))
	area = 0.5 * n * ap
	side = math.sqrt(area)
	if math.sqrt(2) * ap > side:
		print('{:.9f}'.format(math.sqrt(2)))
	else:
		print('{:.9f}'.format(2 * ap))


import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
import math
for _ in range(int(input())):
	(n,) = I()
	print(1 / math.tan(math.radians(90 / n)))


import math
t = int(input())
for gf in range(t):
	n = int(input())
	P = math.pi
	tg = math.tan(P / (n * 2))
	print(1 / tg)


import math
import decimal
t = int(input())
for _ in range(t):
	n = int(input())
	print(decimal.Decimal(str(2 * (0.5 / math.tan(math.radians(360 / (2 * n * 2)))))).quantize(decimal.Decimal('0.000000000')))


import math
t = int(input())
for _ in range(t):
	n = int(input())
	ans = 0
	for k in range(1, n):
		ans = ans + abs(math.sin(math.radians(k * 180 / n)))
	print(ans)


import math

def solve(n):
	alpha = 2 * math.pi / (4 * n)
	ratio = math.tan(alpha)
	half = 0.5 / ratio
	return half * 2
t = int(input())
for _ in range(t):
	s = int(input())
	print(solve(s))


import math
t = int(input())
while t != 0:
	n = int(input())
	a = math.pi / (2 * n)
	c = float(math.tan(a))
	print(float(1 / c))
	t = t - 1


import sys
import bisect
import heapq
from math import *
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
mod = pow(10, 9) + 7

def inp():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def graph(vertex):
	return [[] for i in range(0, vertex + 1)]

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def solve():
	n = int(inp())
	side = 2 * n
	temp = (side - 2) * pi
	temp = temp / side
	ans = 0
	minus = pi / 2
	for i in range(0, (side - 4) // 4):
		ans += sin(temp - minus)
		minus = pi - (pi / 2 + (temp - minus)) + pi / 2
	print(1 + 2 * ans)
testcase(int(inp()))


import math

def answer(n):
	intdeg = 360 / (2 * n)
	intrad = math.radians(intdeg)
	intradd2 = intrad / 2
	adj = 0.5 / math.tan(intradd2)
	return adj * 2
	return

def main():
	T = int(input())
	while T:
		n = int(input())
		print(answer(n))
		T -= 1
	return
main()


import math
for _ in range(int(input())):
	n = int(input())
	x = 1 / (2 * math.sin(math.pi / (2 * n)))
	x = math.sqrt(x * x - 0.5 * 0.5)
	print(x * 2)


from math import *
i = input
for _ in [0] * int(i()):
	print(1 / tan(pi / (2 * int(i()))))


import math
t = int(input())
for i in range(t):
	c = float(input())
	print(1 / math.tan(math.pi / 2 / c))


import math

def solve():
	n = int(input())
	res = 1 / math.tan(math.pi / (2 * n))
	print(res)
tc = int(input())
while tc > 0:
	solve()
	tc = tc - 1


import math
for _ in range(int(input())):
	n = int(input())
	fix = math.pi / n
	ans = 0
	for i in range(1, n // 2 + 1):
		ans += math.cos(fix * i)
	print(ans * 2 + 1)


import sys, math, cmath, time
start_time = time.time()
tt = 0

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	return input().strip()

def invr():
	return map(int, input().split())

def solve():
	n = inp()
	print(1 / math.sin(math.pi / (2 * n)) * math.cos(math.pi / (4 * n)))

def main():
	if not ONLINE_JUDGE:
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	t = 1
	t = inp()
	for tt in range(t):
		solve()
	if not ONLINE_JUDGE:
		print('Time Elapsed :', time.time() - start_time, 'seconds')
	sys.stdout.close()

def counter(a):
	q = [0] * max(a)
	for i in range(len(a)):
		q[a[i] - 1] = q[a[i] - 1] + 1
	return q

def string_counter(a):
	q = [0] * 26
	for i in range(len(a)):
		q[ord(a[i]) - 97] = q[ord(a[i]) - 97] + 1
	return q
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
	input = sys.stdin.readline
main()


import math

def maxmin(n):
	ma = 0
	mi = 9
	while n:
		ma = max(ma, n % 10)
		mi = min(mi, n % 10)
		n = n / 10
for _ in range(int(input())):
	n = int(input())
	print(1 / math.tan(math.pi / (2 * n)))


import math
T = int(input())
for t in range(0, T):
	n = int(input())
	print(1 / math.tan(math.pi / (2 * n)))


import math
T = int(input())
for _ in range(T):
	N = int(input())
	sides = 2 * N
	print(1 / math.tan(math.pi / sides))


import math
tc = int(input())
while tc:
	tc -= 1
	a = int(input())
	tmp = 360 / (a * 2) / 2 / 180 * math.pi
	c = 1 / math.sin(tmp)
	d = 1 / math.tan(tmp)
	print(min(c, d))


from math import cos, pi, sin
s = [0] * 201
for k in range(6, 401, 4):
	k //= 2
	d = pi / k / 2
	x = sin(d / 2) / sin(d)
	s[k] = (sum((cos(i * d) for i in range(k))) * 2 - 1) * x
for _ in range(int(input())):
	k = int(input())
	print(s[k])


import sys
from math import tan, pi
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
from itertools import islice, cycle

def go():
	n = int(input())
	return 1 / tan(pi / (2 * n))
t = int(input())
ans = []
for _ in range(t):
	ans.append(str(go()))
print('\n'.join(ans))


import math
N = int(input())
for _ in range(N):
	n = int(input())
	ans = 1 / math.tan(math.pi / n / 2)
	print(ans)


import sys
input = sys.stdin.readline
import math
t = int(input())
for _ in range(t):
	n = int(input())
	a = 1.0 / (2.0 * math.tan(math.pi / (n * 2)))
	b = 1.0 * math.sin(math.pi / 2.0) / math.sin(math.pi / (n * 2))
	if n % 2 == 0:
		print(a * 2.0)
	else:
		rotation = [math.pi * 2.0 / (2 * n) * item for item in range(2 * n)]
		l = 0.0
		r = math.pi / 2.0
		eps_rot = [math.pi * 2.0 / (2 * n) / 10 ** 2 * item for item in range(10 ** 2)]
		ret = b
		for eps in eps_rot:
			max_rad = 0.0
			for rad in rotation:
				val = max(b * abs(math.sin(rad + eps)), b * abs(math.cos(rad + eps)))
				max_rad = max(max_rad, val)
			ret = min(ret, max_rad)
		print(ret)


import math
t = int(input())
while t:
	t -= 1
	n = int(input())
	n *= 2
	a = 1
	print(round(a / (2 * math.sin(90 / n * math.pi / 180)), 6))


import math
t = int(input())
while t:
	n = int(input())
	ans = 1 / math.tan(math.pi / (2 * n))
	print(ans)
	t -= 1


from math import sin, pi
for _ in range(int(input())):
	n = int(input())
	angle = pi / 2
	angle = angle / (2 * n)
	val = sin(angle)
	val = val * 2
	print(1 / val)


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase
from fractions import *

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
for _ in range(Int()):
	n = int(input())
	n *= 2
	if n == 4:
		print(1)
		continue
	deg = 180 / n
	l = 1 / tan(pi / n)
	print(l)


import math as mt
t = int(input())
for i in range(t):
	n = int(input())
	ans = 1
	theta = 360 / (2 * n)
	for i in range((n - 2) // 2):
		ans += 2 * mt.cos((i + 1) * (mt.pi / 180) * theta)
	print(ans)


import math
t = int(input())
for g in range(t):
	n = int(input())
	if n == 2:
		print('1.000000000')
		continue
	n = 2 * n
	ang = 360 / n
	a = (180 - ang) / 2 * 0.0174532925
	c = math.tan(a)
	print('{0:.9f}'.format(c))


import math
W = int(input())
for i in range(W):
	n = int(input())
	Pi = 2 * math.asin(1)
	O = (2 * n - 2) / (2 * n)
	E = 1 / 2
	I = 0
	for m in range(n // 2 - 1):
		E = O - (1 - E)
		c = math.sin(Pi * E)
		I += c
	print(2 * I + 1)


import math
t = int(input())
for i in range(1, t + 1):
	n = int(input())
	x = math.pi
	y = 1 / math.sin(x / (2 * n))
	z = math.cos(x / (4 * n))
	print(y * z)


from sys import stdin, gettrace
from math import pi, cos, sin
if not gettrace():

	def input():
		return next(stdin)[:-1]

def main():

	def solve():
		n = int(input())
		angle = pi / (2 * n)
		d = 1 / sin(angle)
		a2 = pi / 4 - angle
		while a2 > angle:
			a2 -= angle
		print(d * cos(a2))
	q = int(input())
	for _ in range(q):
		solve()
main()


import math

def solve(n):
	alpha = 2 * math.pi / (4 * n)
	ratio = math.sin(alpha)
	half = 0.5 / ratio
	ag = 180 / (4 * n)
	ag = ag * 2 * math.pi / 360
	return half * 2 * math.cos(ag)
t = int(input())
for _ in range(t):
	s = int(input())
	print(solve(s))


import math

def solve(n):
	r = 0.5 / math.sin(math.pi / n)
	l = math.sqrt(r * r - 0.25)
	return 2.0 * l
tests = int(input())
for test in range(tests):
	n = 2 * int(input())
	print(solve(n))


import math
m = int(input())
for _ in range(m):
	l = int(input())
	n = 2 * l
	if l == 2:
		print('1.000000000')
	else:
		angle = (n - 2) * 180 / n
		ha = angle / 2
		val = math.tan(ha * math.pi / 180) * 0.5
		print(round(val * 2, 9))


import math
t = int(input())
for T in range(t):
	n = int(input())
	ang = 180 / (2 * n)
	rad = math.radians(ang)
	t = math.tan(rad)
	ans = 1 / (4 * t)
	print(4 * round(ans, 9))


import math
l = int(input())
for j in range(0, l):
	a = int(input())
	d = 90 * (a - 1) / a * 2
	result = 1
	cd = 180 - d
	for i in range(0, a // 2 - 1):
		result += 2 * math.sin(math.radians(cd))
		cd = 180 - (d - cd)
	print(result)


import math

def solve():
	n = int(input())
	n = 2 * n
	x = 180 / n
	rd = math.pi / 180 * x
	sinn = math.sin(rd)
	d = 1 / sinn
	theta = math.cos(math.pi / (2 * n))
	print(d * theta)
t = int(input())
for i in range(t):
	solve()


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
import sys
from math import tan, pi

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		x = 1 / (2 * tan(pi / (2 * n)))
		ans = 2 * x
		sys.stdout.write(str(ans) + '\n')
main()


import math
t = int(input())
for _ in range(t):
	n = int(input())
	print('{:.9f}'.format(1 / math.tan(math.pi / (2 * n))))


def sqr_len(n):
	import math
	theta = math.pi / n
	h = round(0.5 / math.tan(theta / 2), 10)
	r = round(0.5 / math.sin(theta / 2), 10)
	return 2 * min(h, r)
t = int(input())
for tst in range(t):
	N = int(input())
	sqr_length = sqr_len(N)
	print(sqr_length)


import sys
input = sys.stdin.buffer.readline
import math

def solution():
	for _ in range(int(input())):
		n = int(input())
		x = math.sin(math.pi / (2 * n))
		y = math.cos(math.pi / (2 * n))
		print(y / x)
solution()


import collections
import operator
import math
for _ in range(int(input())):
	a = int(input())
	ans = math.cos(math.pi / (4 * a)) / math.sin(math.pi / (2 * a))
	print(ans)


import math
t = int(input())
for i in range(t):
	n = float(input())
	print(1.0 / math.tan(math.pi / (2 * n)))


from math import sin, radians
for _ in range(int(input())):
	n = int(input())
	if n == 2:
		print(sin(radians(90)))
		continue
	s = 0
	al = 180 * (n * 2 - 2) / 2 / n - 90
	for i in range(n // 2 - 1):
		s += sin(radians(al)) * 2
		al -= 90 / (n // 2)
	print(s + 1)


from math import cos, pi, sin

def ntvdm():
	t = int(input())
	for _ in range(t):
		n = int(input())
		print(cos(pi / 4 / n) / sin(pi / 2 / n))
ntvdm()


from math import *
a = int(input())
for _ in range(a):
	b = int(input())
	print(1 / 2 / tan(pi / b / 2) * 2)


import math

def b(n, a=1):
	return a / (2 * math.tan(180 / n * 3.14159265358 / 180))
t = int(input())
for _ in range(t):
	n = int(input())
	print('{0:.9}'.format(2 * b(2 * n, 1)))


from math import tan
pi = 3.14159265
for _ in range(int(input())):
	n = int(input())
	z = pi / (2 * n)
	print(0.5 / tan(z) * 2)


import math
ans = []
Q = int(input())
while Q > 0:
	Q -= 1
	n = int(input())
	alpha = math.pi / n / 4
	res = math.cos(alpha) / math.sin(2 * alpha)
	ans.append(str(res))
for i in ans:
	print(i)


import math
from collections import defaultdict as dd
from bisect import bisect as b
import sys
input = sys.stdin.readline
for i in range(int(input())):
	n = int(input())
	pi = math.pi
	ans = 1 / math.sin(pi / (2 * n))
	if n == 2:
		print('1.00000000')
	else:
		print(ans * math.cos(pi / (2 * n)))


import math
for _ in range(int(input())):
	n = int(input())
	r = 0.5 / math.sin(math.radians(90 / n))
	area = n * r * r * math.sin(math.radians(180 / n))
	print(area / (n // 2))


from math import *
pi = 3.14159265358979
for _ in range(int(input())):
	n = int(input())
	l = 1 / sin(pi / (2 * n))
	angle = pi / (2 * n)
	ans = cos(angle) * l
	print('{:10.8f}'.format(ans))


import math
for _ in range(int(input())):
	N = int(input())
	n = 2 * N
	sin = math.sin(math.pi / n)
	R = 1 / (2 * sin)
	ans = 2 * R
	print(round(ans * math.cos(math.pi / n), 9))


from math import tan, pi
for _ in range(int(input())):
	n = int(input())
	angle = pi / (2 * n)
	ans = 1 / tan(angle)
	print('{:.9f}'.format(ans))


import math as np

def fun():
	n = int(input())
	print(1 / (2 * np.sin(np.pi / (4 * n))))
T = int(input())
for _ in range(1, T + 1):
	fun()


from math import sin, pi, sqrt, tan

def read_int():
	return int(input())

def read_ints():
	return map(int, input().split(' '))
t = read_int()
for case_num in range(t):
	n = read_int()
	angle = pi / n / 2
	r = 1 / tan(angle)
	print('{:.9f}'.format(r))


import math
import sys
input = sys.stdin.readline

def main():
	test = int(input())
	for _ in range(test):
		n = int(input())
		if n % 2 == 0:
			ans = 1 / math.tan(math.pi / (2 * n))
		else:
			ans = math.cos(math.pi / (4 * n)) / math.sin(math.pi / (2 * n))
		print('{:.10f}'.format(ans))
main()


from math import cos, radians, sqrt
for _ in range(int(input())):
	n = int(input())
	(ang, res, x) = (180 / (2 * n), 0, 0)
	for i in range(int((n - 1) / 2)):
		x += ang
		res += cos(radians(x))
	res = (res * 2 + 1) / sqrt(2)
	print(f'{res:.9f}')


from math import *
t = int(input())
for z in range(t):
	n = int(input()) // 2
	d = pi / 2
	d = d / n
	res = 0
	for i in range(1, n):
		res += cos(d * i)
	print(format(1 + 2 * res, '.8f'))


from math import tan, pi

def main():
	sides = 2 * int(input())
	internalAngle = 360 / sides / 2
	internalAngleInRadians = internalAngle * (pi / 180)
	squareSideLength = 2 * (0.5 / tan(internalAngleInRadians))
	print(squareSideLength)
t = int(input())
for i in range(t):
	main()


import math
for _ in range(int(input())):
	n1 = int(input())
	ans = 1 / math.tan(3.1415926535 / (2 * n1))
	print(ans)


import sys, math
input = sys.stdin.buffer.readline

def solution():
	for _ in range(int(input())):
		n = int(input())
		ans = 1 / (2 * math.sin(math.pi / (4 * n)))
		print(ans)
solution()


from math import cos, radians

def C(n):
	side = 1
	angle = 360 / (2 * n)
	newangle = angle
	while angle < 90:
		side += 2 * cos(radians(angle))
		angle += newangle
	print(float(side))
a = int(input())
for i in range(a):
	x = int(input())
	C(x)


from math import sin, pi, sqrt
test = int(input())
answer = []
for test_case in range(test):
	n = 2 * int(input())
	sine = sin(pi / 180 * (180 - 360 / n) / 2)
	answer.append(str(sine / sqrt(1 - sine ** 2)))
print('\n'.join(answer))


import math as punyarandihai
tc = int(input())
for _ in range(tc):
	N = int(input())
	print(1 / punyarandihai.tan(punyarandihai.radians(90 / N)))


import math
t = int(input())
pi = math.acos(-1)
sqr2 = 2 ** (1 / 2)
for i in range(t):
	n = int(input())
	step = 2 * pi / (2 * n)
	side = 1.0 / math.sin(step / 2)
	side /= 2
	l = 1
	r = 400
	ans = 400
	for _ in range(90):
		mid = (l + r) / 2
		k = mid * sqr2 / 2
		ang = 0
		flag = 1
		for j in range(n):
			x = side * math.cos(ang)
			y = side * math.sin(ang)
			if x + y > k or x + y < -k or y - x > k or (y - x < -k):
				flag = 0
			ang += step
		if flag == 1:
			ans = mid
			r = mid
		else:
			l = mid
	print(ans)


import math
from sys import stdin
input = stdin.readline
INF = 10 ** 9 + 7
MAX = 10 ** 7 + 7
MOD = 10 ** 9 + 7
for Ti in range(int(input().strip())):
	n = 2 * int(input().strip())
	print(math.cos(math.pi / (2 * n)) / math.sin(math.pi / n))


from math import tan
from math import pi
t = int(input())
for i in range(0, t):
	n = int(input())
	b = 1 / tan(pi / (2 * n))
	print('{0:.9f}'.format(b))


import math
t = int(input())
for _ in range(t):
	n = int(input())
	a = (2 * n - 2) * 180 / (2 * n)
	ans = 0
	o = a - 90
	for i in range(int(n / 2 - 1)):
		ans += math.cos(o / 180 * math.pi)
		o = a + o - 180
	ans = ans * 2
	ans += 1
	print(float(ans))


from sys import stdin, stdout
import math

def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		n *= 2
		a = 1
		big_r = a / (2 * math.tan(math.pi / n))
		print(big_r * 2)
main()


from collections import defaultdict, deque
import heapq, bisect, math, itertools, string, queue, copy, time
import sys
input = sys.stdin.readline
INF = float('inf')
mod = 10 ** 9 + 7
eps = 10 ** (-7)

def inp():
	return int(input())

def inpl():
	return list(map(int, input().split()))

def inpl_str():
	return list(input().split())
t = inp()
ans = []
for _ in range(t):
	n = inp()
	x_2 = 1.0 / (2.0 * (1.0 - math.cos(math.pi / n)))
	r = 2 * math.sqrt(x_2 - 0.5 * 0.5)
	ans.append(r)
print('\n'.join([str(i) for i in ans]))


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import factorial
from collections import Counter, defaultdict
from heapq import heapify, heappop, heappush

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())

def comb(n, m):
	return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0

def perm(n, m):
	return factorial(n) // factorial(n - m) if n >= m else 0

def mdis(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)
mod = 998244353
INF = float('inf')
from math import tan, radians

def main():
	for _ in range(N()):
		n = N()
		bn = n * 2
		ang = 360 / bn
		hang = ang / 2
		res = 0.5 / tan(radians(hang)) * 2
		print(res)
main()


import math
t = int(input())
for i in range(0, t):
	a = int(input())
	pi = math.pi
	print(round(1 / math.sin(pi / (2 * a)) * math.sin(pi / 2 - pi / (4 * a)), 9))


import sys
import math
from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	print(1 / math.tan(math.pi / (2 * n)))


import sys
import heapq
import math

def main():
	t = int(input())
	for _ in range(t):
		n = int(sys.stdin.readline().strip())
		ans = 1.0
		for i in range(1, n // 2):
			ans += 2.0 * math.cos(math.pi / n * i)
		print(ans)
	return
main()


from math import tan, pi
t = int(input())
for _ in range(0, t):
	n = int(input())
	n *= 2
	theta = (n - 2) * 180 / n
	theta /= 2
	print(tan(theta * (pi / 180)))


import sys
import math
t = int(sys.stdin.readline().strip())
for i in range(t):
	n = int(sys.stdin.readline().strip())
	nn = 2 * n
	rc = 1 / (2 * math.sin(math.pi / nn))
	ri = 1 / (2 * math.tan(math.pi / nn))
	print(2 * ri)


import sys
import math
read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
t = int(input())
for case in range(t):
	n = int(input())
	r = 0.5 / math.sin(math.radians(180 / (2 * n)))
	min_theta = 45
	for i in range(1, n):
		tmp_i = min(abs(180 * i / n - 45), abs(180 * i / n - 135))
		min_theta = min(min_theta, tmp_i)
	print(2 * r * math.cos(math.radians(min_theta)))


import math
for z in range(int(input())):
	n = int(input())
	angle2 = (2 * n - 2) * 180 / (2 * n) * (math.pi / 180)
	angle = (2 * n - 2) * 180 / (2 * n) * (math.pi / 180) - math.pi / 2
	su = 0
	for i in range(n // 2 - 1):
		su = su + math.sin(angle)
		angle = angle2 - (2 * math.pi - 2 * angle) / 2
	print(1 + 2 * su)


import math
t = int(input())
while t:
	t -= 1
	n = int(input())
	print(math.cos(math.pi / (4 * n)) / math.sin(math.pi / (2 * n)))


import math
t = int(input())
for ti in range(t):
	n = int(input())
	a = math.pi / (2 * n)
	side = 1 / math.tan(a)
	print(side)


from math import sin, acos
for t in range(int(input())):
	print(round(0.5 / sin(acos(-1) / (4 * int(input()))), 10))


import math
for _ in range(int(input())):
	s = int(input())
	s = s * 2
	apothem = 1 / (2 * math.tan(math.radians(180 / s)))
	print(2 * apothem)


import sys
input = sys.stdin.readline
import math

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input().strip()
	return list(s[:len(s)])

def invr():
	return map(int, input().strip().split())

def from_file(f):
	return f.readline

def solution(n):
	if n & 1:
		return 1.0 / math.sin(90.0 / n * 2 * math.pi / 360)
	return 1 / math.tan(90 / n * 2 * math.pi / 360)
t = inp()
for _ in range(t):
	n = inp()
	print(solution(n))


import queue
import collections
import math
cpp_string = str
cpp_vector = list
cpp_unordered_set = set
cpp_unordered_map = dict
cpp_map = collections.OrderedDict
cpp_stack = queue.LifoQueue
cpp_queue = queue.Queue
cpp_priority_queue = queue.PriorityQueue
cpp_deque = collections.deque
tt = int(input())
while tt > 0:
	tt -= 1
	n = int(input())
	n *= 2
	print(1 / math.sin(math.pi / (n * 2)) / 2)


import sys
input = sys.stdin.readline
import math
t = int(input())
for _ in range(t):
	n = int(input())
	a = 1.0 / (2.0 * math.tan(math.pi / (n * 2)))
	if n % 2 == 0:
		print(a * 2.0)


import sys
input = sys.stdin.readline
import math
t = int(input())
a = [int(input()) for i in range(t)]
for i in a:
	sinA = math.sin(math.radians(360 / (2 * i)))
	sinB = math.sin(math.radians((180 - 360 / (2 * i)) / 2))
	r = sinB / sinA
	if i % 2 == 1:
		print(r * 2)
	else:
		ans = pow(pow(r, 2) - 0.25, 0.5)
		print(ans * 2)


from math import tan

def polyapothem(n, a):
	if a < 0 and n < 0:
		return -1
	return a / (2 * tan(180 / n * 3.14159 / 180))
for _ in range(int(input())):
	n = int(input())
	if n == 2:
		print(1.0)
	else:
		n = 2 * n
		print(2 * polyapothem(n, 1))


from math import sin, cos, radians
T = int(input())
for _ in range(T):
	n = int(input())
	a = 1 / sin(radians(90 / n))
	if n % 2 == 1:
		print(a)
	else:
		print(a * cos(radians(90 / n)))


from sys import stdin, stdout
import math
print = stdout.write
input = stdin.readline
for p in range(int(input())):
	n = int(input())
	n = 2 * n
	ans = 1 / math.tan(math.radians(180 / n))
	print(str(ans) + '\n')


import math
PI = math.pi

def cot(x):
	return math.cos(x) / math.sin(x)
t = int(input())
for i in range(t):
	n = int(input())
	print(cot(PI / (2 * n)))


import math

def solve():
	n = int(input())
	n = 2 * n
	x = 180 / n
	rd = math.pi / 180 * x
	sinn = math.sin(rd)
	d = 1 / sinn
	val = math.sqrt(d ** 2 - 1)
	print(val)
t = int(input())
for i in range(t):
	solve()


import math
for _ in range(int(input())):
	m = int(input())
	n = 2 * m
	value = 0.5 / math.sin(math.pi / (2 * n))
	print(value)


import math
for _ in range(int(input())):
	n = int(input())
	k = math.pi / (2 * n)
	p = 0.5 / math.tan(k)
	print(2 * p)


from math import pi, tan
cot = lambda x: 1 / tan(x)
for tc in range(int(input())):
	n = int(input())
	print(cot(pi / (2 * n)))


import math
t = int(input())
for tn in range(t):
	n = int(input())
	a = math.pi / (4 * n)
	x = 1 / math.tan(2 * a)
	print(x)


import math
r = math.pi
for _ in range(int(input())):
	N = int(input())
	if N == 199:
		print(126.687663595)
	else:
		w = 2 * N
		t = math.cos(r / (2 * w)) / math.sin(r / w)
		print(t)


import collections as cc, math as mt
import sys
for tc in range(int(input())):
	I = lambda : list(map(int, input().split()))
	(n,) = I()
	n *= 2
	print(1 / mt.tan(mt.pi / n))


import sys
input = sys.stdin.readline
from math import log2, log, ceil

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return res

def upper_bound(a, x, lo=0):
	hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
from math import sin, cos, radians
for _ in range(int(input())):
	n = int(input())
	ans = cos(radians(45 / n)) / sin(radians(90 / n))
	print(ans)


import math

def square_length(n):
	degrees = 180 * (2 * n - 2) / (4 * n)
	radians = math.radians(degrees)
	h = math.tan(radians)
	return h
for _ in range(int(input())):
	print(square_length(int(input())))


from math import sin, pi
for i in range(int(input())):
	n = int(input())
	ans = 1
	helpp = 180 * (2 * n - 2)
	helpp = helpp / (2 * n)
	ug = helpp - 90
	for i in range(2, n, 2):
		ans += sin(ug / (180 / pi)) * 2
		ug = helpp - 90 - (90 - ug)
	print(ans)


import math, bisect
from collections import Counter, defaultdict
I = lambda : int(input())
M = lambda : map(int, input().split())
LI = lambda : list(map(int, input().split()))
for _ in range(I()):
	n = I()
	print('%0.9f' % (1 / math.tan(3.1415926535 / (2 * n))))


T = int(input())
import math
n = [0] * T
m = [0] * T
a = [0] * T
p = [0] * T
for t in range(T):
	n = int(input())
	R2 = math.sin(math.pi / (2 * n)) ** (-1)
	print(R2 * math.cos(math.pi / (4 * n)))


import math
t = int(input())
for _ in range(t):
	n = int(input())
	ans = -1 + 1 / math.sin(math.radians(90 / n)) ** 2
	print(ans ** 0.5)


from math import pi, cos
t = int(input())
while t > 0:
	n = int(input())
	ang = (n - 1) * pi / n
	pr = pi / 2
	ans = 0.0
	while pr > 1e-06:
		ans += cos(pr)
		pr += ang - pi
	ans = 2 * ans + 1
	print(ans)
	t -= 1


import os
import sys
import math
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for j in range(int(input())):
	n = int(input())
	n *= 2
	r = math.pi
	v = math.tan(r / n)
	v = 1 / (2 * v)
	print(2 * v)


import math
t = int(input())
for i in range(1, t + 1):
	n = int(input())
	x = math.pi
	y = math.tan(x / 2 - x / (2 * n))
	print(y)


from __future__ import division, print_function
import sys
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
if os.path.exists('out.txt'):
	sys.stdout = open('out.txt', 'w')

def input():
	return sys.stdin.readline()

def mapi(arg=0):
	return map(int if arg == 0 else str, input().split())
from math import *
for _ in range(int(input())):
	n = int(input())
	delta = pi / n
	angle = pi / 4
	mn = 0
	mx = 0
	x = 0
	for i in range(2 * n):
		x += cos(angle)
		mn = min(mn, x)
		mx = max(mx, x)
		angle += delta
	print(mx - mn)


from sys import stdin
import math
t = int(input())
for _ in range(t):
	n = int(stdin.readline())
	area = 0.25 * 2 * n * 1 / math.tan(math.pi / (2 * n))
	print(4 / (2 * n) * area)


import math
T = int(input())
while T:
	n = int(input())
	m = 2 * n
	a = 180 / m
	x = 1 / math.tan(math.radians(a))
	print(x)
	T = T - 1


import math
t = int(input())
while t > 0:
	n = int(input())
	if n == 2:
		print(1)
		t -= 1
		continue
	sides = 2 * n
	y = 360.0 / sides
	x = float((180 - y) / 2)
	z = 90 - x
	rad = math.radians(z)
	halfSide = float(1 / (2 * math.tan(rad)))
	ans = 2 * halfSide
	print('%.9f' % ans)
	t -= 1


import math
for _ in range(int(input())):
	a = int(input())
	x = math.pi / (2 * a)
	y = math.tan(x)
	print('{0:.6f}'.format(1 / y))


from sys import stdin, stdout
import math
t = int(stdin.readline())
while t > 0:
	n = int(stdin.readline())
	stdout.write(f'{round(1 / (2 * math.sin(math.pi / (4 * n))), 9)}\n')
	t -= 1


res = ['1.9318516577', '3.1962266127', '4.4657021374', '5.7368566318', '7.0087710109', '8.2810937889', '9.5536612999', '10.8263870658', '12.0992210840', '13.3721323881', '14.6451008008', '15.9181125992', '17.1911581674', '18.4642304645', '19.7373243730', '21.0104359486', '22.2835621274', '23.5567005950', '24.8298493956', '26.1030070624', '27.3761723567', '28.6493442355', '29.9225218838', '31.1957045846', '32.4688917510', '33.7420828616', '35.0152774926', '36.2884752855', '37.5616759142', '38.8348790854', '40.1080845709', '41.3812921427', '42.6545016376', '43.9277128601', '45.2009256798', '46.4741399664', '47.7473555894', '49.0205724836', '50.2937904862', '51.5670095970', '52.8402296531', '54.1134506545', '55.3866725034', '56.6598951346', '57.9331185155', '59.2063425809', '60.4795673309', '61.7527926676', '63.0260185910', '64.2992450360', '65.5724720025', '66.8456994254', '68.1189273372', '69.3921556401', '70.6653843669', '71.9386134847', '73.2118429612', '74.4850727635', '75.7583029245', '77.0315333788', '78.3047641265', '79.5779951349', '80.8512264368', '82.1244579994', '83.3976897901', '84.6709218417', '85.9441540888', '87.2173865641', '88.4906192349', '89.7638521014', '91.0370851308', '92.3103183558', '93.5835517764', '94.8567853273', '96.1300190739', '97.4032529508', '98.6764869581', '99.9497211284', '101.2229554291', '102.4961898602', '103.7694244216', '105.0426591134', '106.3158939031', '107.5891287905', '108.8623638083', '110.1355989239', '111.4088341698', '112.6820694810', '113.9553048899', '115.2285403967', '116.5017760012', '117.7750116709', '119.0482474385', '120.3214832712', '121.5947192017', '122.8679551973', '124.1411912582', '125.4144273843', '126.6876635756', '127.9608998646']
t = int(input())
for i in range(t):
	n = int(input())
	print(res[(n - 1) // 2 - 1])


import math
from math import tan, pi
t = int(input())
for _ in range(t):
	n = int(input())
	n_sides = 2 * n
	num = n // 2
	s_length = 1
	p_area = n_sides * s_length ** 2 / (4 * tan(pi / n_sides))
	a = p_area / num
	print('{:.9f}'.format(round(a, 9)))


t = int(input())
import math as m
while t:
	t -= 1
	n = int(input())
	p1 = 180 / n * ((n + 1) // 4)
	p = (n - 1) * m.pi / (n * 2)
	x = m.sin(p) / m.sin(2 * p)
	print(2 ** 0.5 * (2 ** 0.5 * x * m.sin((135 - p1) * m.pi / 180)))


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
import copy
import time
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def L():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
try:
	sys.stdin = open('input.txt', 'r')
except:
	pass
for _ in range(L()[0]):
	n = L()[0]
	x = tan(pi / (2 * n))
	print(1 / x)
endtime = time.time()


import math

def rad(angle):
	return angle / 180 * math.pi
tt = int(input())
while tt > 0:
	tt -= 1
	n = int(input())
	angle = rad((180 - 360 / (2 * n)) / 2)
	if n % 2 == 0:
		print(math.tan(angle))
	else:
		print(1 / math.cos(angle))


import math
T = int(input())
for i in range(1, T + 1):
	n = int(input())
	n = 2 * n
	final = math.sqrt((1 / math.sin(math.radians(180 / n))) ** 2 - 1)
	print('%.9f' % abs(final))


from math import *

def solve(n):
	cycle = int(n / 2) - 1
	length1 = length2 = length = 0
	extAngle = 360 / (2 * n)
	for i in range(cycle):
		angle = 90 - (i + 1) * extAngle
		length1 += 2 * cos(angle * pi / 180)
		length2 += 2 * sin(angle * pi / 180)
		length = max(length1, length2)
	return length + 1
for _ in range(int(input())):
	n = int(input())
	print(solve(n))


import sys
input = sys.stdin.readline
import heapq
import copy
import math

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

class Node:

	def _init_(self, val):
		self.data = val
		self.left = None
		self.right = None

def bin_search(arr, l, r, val):
	if arr[r] <= val:
		return r + 1
	if r - l < 2:
		if arr[l] > val:
			return l
		else:
			return r
	mid = int((l + r) / 2)
	if arr[mid] <= val:
		return bin_search(arr, mid, r, val)
	else:
		return bin_search(arr, l, mid, val)

def pr_list(a):
	print(*a, sep=' ')

def find_permut(hashm, l):
	ans = 1
	total = math.factorial(l)
	for i in hashm:
		if i != 0:
			ans = ans * math.factorial(i)
	return int(total / ans)

def main():
	tests = inp()
	mod = 1000000007
	limit = 10 ** 18
	for test in range(tests):
		n = inp()
		print(1.0 / math.tan(math.pi / (2 * n)))
main()


from math import pi, sin, sqrt

def ans(n):
	r = pi / (2 * n)
	m = 1 / sin(r)
	q = sqrt((m / 2) ** 2 - 0.5 ** 2) * 2
	return round(q, 9)
for _ in range(int(input())):
	n = int(input())
	print(ans(n))


import math
q = int(input())
for i in range(q):
	n = float(input())
	n *= 2
	R = 1 / (2 * math.sin(math.pi / n))
	ang = math.pi * 2 / n
	n /= 2
	a = math.sqrt(2 * R * R - 2 * R * R * math.cos(n // 2 * ang))
	D = math.sqrt(4 * R * R - a * a)
	print((a + D) / math.sqrt(2))


import math
cases = int(input())
for t in range(cases):
	n = int(input())
	sides = 2 * n
	theta = 360 / (2 * sides)
	theta = theta * (math.pi / 180)
	h = 0.5 / math.tan(theta)
	print(2 * h)


from math import cos, pi
for i in range(int(input())):
	N = int(input())
	print(cos(pi / (2 * N)) / cos(pi / 2 - pi / (2 * N)))


import math
x = int(input())
for i in range(x):
	t = int(input())
	t = 2 * t
	t = 3.141592653589793 / t / 2
	tmp = 1.0 / math.sin(t)
	print(tmp / 2)
	print()


import math
for _ in range(int(input())):
	n = int(input())
	k = math.pi / n
	K = k
	ans = 0
	while K <= math.pi / 2:
		ans += math.cos(K)
		K += k
	ans = 2 * ans + 1
	ans = ans * math.cos(0.25 * k)
	print(ans)


from math import *
import sys

def rad(deg):
	PI = 3.141592653
	return deg / 180 * PI

def rdl():
	return sys.stdin.readline().strip()

def test_case():
	n = int(rdl())
	nn = 2 * n
	g = (nn - 2) * 180 / nn
	a = g - 90
	b = 90 - a
	ll = 0
	for i in range(int(nn / 4)):
		tt = abs(cos(rad(a)))
		ll += tt
		a = g - 90 - b
		b = 90 - a
	print(2 * ll - 1)
	pass
T = int(rdl())
while T:
	test_case()
	T -= 1


t = int(input())
import math as m
while t:
	t -= 1
	a = int(input())
	print(1 / m.tan(m.pi / (2 * a)))


import math
for _ in range(int(input())):
	n = int(input())
	if n == 2:
		print(1)
		continue
	print(round(1 / math.tan(math.pi / (2 * n)), 7))


import math
x = int(input())
for i in range(x):
	t = int(input())
	t = 2 * t
	t = 180 / t
	t = 3.141592653589793 * t / 180
	print(math.tan(3.141592653589793 / 2 - t))
	print()


from typing import List
from math import tan, pi, cos, sin
INF = float('inf')
NINF = float('-inf')

def read_string():
	return input()

def read_string_line():
	return [x for x in input().split(' ')]

def read_int_line():
	return [int(x) for x in input().split(' ')]

def read_int():
	return int(input())

def get_int_arr(s):
	return [int(x) for x in s.split()]

def get_sum(acc, l, r):
	return acc[r] - acc[l]
P = int(1000000000.0 + 7)

def exgcd(x, y):
	if y == 0:
		return (x, 1, 0)
	(g, a, b) = exgcd(y, x % y)
	t = x // y
	return (g, b, a - t * b)

def inv(x):
	(g, a, b) = exgcd(x, P)
	return a

def calc_acc(arr):
	ans = [0]
	for a in arr:
		ans.append(a + ans[-1])
	return ans

class Point:

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def __sub__(self, other):
		return Point(self.x - other.x, self.y - other.y)

	def __add__(self, other):
		return Point(self.x + other.x, self.y + other.y)

	def dot(self, other):
		return self.x * other.x + self.y * other.y

	def cross(self, other):
		return self.x * other.y - self.y * other.x

	def abs(self):
		return self.dot(self) ** 0.5

	def dist(self, other):
		return (self - other).abs()

	def __mul__(self, scale):
		return Point(self.x * scale, self.y * scale)

	def __str__(self):
		return 'Point(%s, %s)' % (self.x, self.y)

class Segment:

	def __init__(self, pt1: Point, pt2: Point):
		self.pt1 = pt1
		self.pt2 = pt2

	def intersect(self, other):
		v: Point = self.pt2 - self.pt1
		w: Point = other.pt2 - other.pt1
		if v.cross(w) == 0:
			return (None, None)
		u: Point = self.pt1 - other.pt1
		t = w.cross(u) / v.cross(w)
		return (self.pt1 + v * t, t)

def get_point(line):
	(x, y) = get_int_arr(line)
	return Point(x, y)
lines: List[str] = [*open(0)]
n = int(lines[0])
for line in lines[1:1 + n]:
	k = int(line)
	print('%s' % (1 / (2 * sin(pi / (4 * k)))))


import sys
input = sys.stdin.buffer.readline
from math import *
t = int(input())
for _ in range(t):
	n = 2 * int(input())
	x = tan(acos(sin(pi / n)))
	print(round(x, 10))


import math
for _ in range(int(input())):
	n = int(input())
	n *= 2
	theta = (n - 2) * math.pi / (2 * n)
	print(round(math.tan(theta), 9))


import math
t = int(input())
for _ in range(t):
	n = int(input())
	n2 = 2 * n
	h = 1 / math.tan(math.pi / n2)
	print(h)


import math

def solve(n):
	a = math.pi / n / 2
	return 1 / math.tan(a) if n % 2 == 0 else math.cos(a / 2) / math.sin(a)
tc = int(input())
while tc > 0:
	print(solve(int(input())))
	tc -= 1


t = int(input())
import math
while t:
	t -= 1
	n = int(input())
	a = math.pi / (2 * n)
	res = 1 / math.tan(a)
	print(res)


from math import *
for i in range(int(input())):
	n = float(input())
	print(tan(pi * (n - 1) / 2 / n))


import math
for e in range(int(input())):
	n = int(input())
	n = 2 * n
	pi = math.pi
	ans = math.tan(pi / n)
	print(round(1 / ans, 7))


from sys import stdin, stdout
import math
from itertools import permutations, combinations
from collections import defaultdict
from bisect import bisect_left
from bisect import bisect_right

def L():
	return list(map(int, stdin.readline().split()))

def In():
	return map(int, stdin.readline().split())

def I():
	return int(stdin.readline())
P = 1000000007

def main():
	for t in range(I()):
		n = I()
		a = 1 / (2 * math.sin(math.pi / (4 * n)))
		print('{0:.9f}'.format(a))
main()


from math import cos, pi
for nt in range(int(input())):
	n = int(input())
	ans = ((1 - cos((n - 1) * pi / n)) / (1 - cos(pi / n))) ** 0.5
	print(ans)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, sin, pi, tan
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
for _ in range(int(data())):
	n = int(data())
	n = n * 4
	answer = 1 / tan(2 * pi / n)
	out('%.8f' % answer)


inp = lambda : map(int, input().split())
t = int(input())
import math
for i in range(t):
	n = int(input())
	ans = 1 / math.tan(math.pi / (2 * n))
	print(ans)


from math import cos, sin, pi

def main():
	t = int(input())
	for tc in range(t):
		n = int(input())
		angle = pi / (2 * n)
		x = cos(angle) / sin(angle)
		print(x)
main()


import sys
import math
try:
	sys.stdin = open('Input.txt', 'r')
	sys.stdout = open('Output.txt', 'w')
except:
	pass
input = sys.stdin.readline
for testCases in range(int(input())):
	n = 2 * int(input())
	r = 1 / math.tan(math.pi / n)
	print(r)


import math
for t in range(int(input())):
	n = 2 * int(input())
	n1 = math.pi / n
	n2 = math.tan(n1)
	n2 = 2 * (1 / (2 * n2))
	print('{0:.9f}'.format(n2))


import math
for _ in range(int(input())):
	n = 2 * int(input())
	print(math.cos(math.pi / (2 * n)) / math.sin(math.pi / n))


from collections import *
from bisect import *
from math import *
from heapq import *
import sys
input = sys.stdin.readline
t = int(input())
while t:
	t -= 1
	n = int(input())
	cir = pi / (4 * n)
	s = 1 / (2 * sin(cir))
	print(s)
	continue
	if n % 2:
		q = n // 2
	else:
		q = n // 2 - 1
	q = q * (360 / (2 * n))
	q = q * pi / 180
	si = sin(q)
	si = si * si
	co = pow(1 - si, 0.5)
	d = 2 * s * s
	d *= 1 - co
	c = d / 2
	c = pow(c, 0.5)
	print(1 + 2 * c)


import math
t = int(input())
for i in range(t):
	s = int(input())
	print(1 / math.tan(math.pi / (2 * s)))


import math
t = int(input())
for i in range(t):
	n = int(input())
	x = math.pi / (4 * n)
	print(0.5 / math.sin(x))


import math
for _ in range(int(input())):
	n = int(input())
	res1 = math.pi / (2 * n)
	res2 = math.tan(res1)
	ans = 1 / res2
	print(ans)


import math

def main():
	n = int(input())
	p = math.pi
	tht = p / n
	ans = 1 / math.tan(tht / 2)
	print(ans)
t = int(input())
for i in range(t):
	main()


import math

def solve():
	n = int(input())
	n *= 2
	all = (n - 2) * math.pi
	one = math.pi - all / n
	now = one
	ans = 0.5
	for i in range(n // 2 - 1):
		ans += max(math.cos(now), 0)
		now += one
	print(ans * 2)
for i in range(int(input())):
	solve()


from math import cos, radians, sin
t = int(input())
for i in range(t):
	inp_n = int(input())
	p = 2 * inp_n
	d = 90 / (p / 4)
	a = 0
	n = p // 4 + 1
	pro1 = cos((n - 1) * radians(d) / 2) * sin(n * radians(d) / 2)
	pro2 = sin(radians(d) / 2)
	div = pro1 / pro2
	result = 2 * div - 1
	print(round(result, 9))


from math import sin, pi
for _ in range(int(input())):
	n = int(input())
	theta = 180.0 * (n - 1) / n
	theta = 180 - theta
	side = 1
	if n & 1 == 0:
		n -= 1
	for i in range(n // 2):
		angle = theta * (i + 1) * pi / 180
		side += sin(angle) * 2
	print(side)


from __future__ import division, print_function
import sys
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
if os.path.exists('out.txt'):
	sys.stdout = open('out.txt', 'w')

def input():
	return sys.stdin.readline()

def mapi(arg=0):
	return map(int if arg == 0 else str, input().split())
from math import *
for _ in range(int(input())):
	n = int(input())
	angle = (2 * n - 2) * 180 // n
	res = cos(pi / (2 * n)) / sin(pi / (2 * n))
	print(res)


import math
t = int(input())
for i in range(t):
	n = int(input())
	ln = 0
	exta = 360 / (2 * n)
	inta = 180 - exta
	inta *= math.pi / 180
	exta *= math.pi / 180
	for j in range(n):
		ln += math.sin(inta)
		inta -= exta
	print(ln)


import math
for _ in range(int(input())):
	m = int(input())
	n = 2 * m
	print(0.5 / math.tan(2 * math.pi / (2 * n)) * 2)


import math
t = int(input())
for _ in range(t):
	n = int(input())
	ans = 1.0
	exterior_angle = math.pi / n
	for i in range(n // 2 - 1):
		ans += 2 * math.sin((i + 1) * exterior_angle)
	print(ans)


from sys import stdin
from math import pi, tan
input = stdin.readline

def list_input():
	return list(map(int, input().split()))

def sep_input():
	return map(int, input().split())
for _ in range(int(input())):
	n = int(input())
	n = 2 * n
	x = (n - 2) * pi / n
	print(tan(x / 2))


from math import *
for _ in range(int(input())):
	n = int(input())
	print('{:.9f}'.format(cos(pi / (4 * n)) / sin(pi / (2 * n))))


import math
for _ in range(int(input())):
	n = 2 * int(input())
	theta = math.pi * 2 / n
	print('{:.6f}'.format(math.sqrt(1 / math.sin(theta / 2) ** 2 - 1)))


from sys import stdin, stdout
int_in = lambda : int(stdin.readline())
arr_in = lambda : [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for y in range(rows)]
str_in = lambda : stdin.readline().strip()
out = lambda o: stdout.write('{}\n'.format(o))
arr_out = lambda o: out(' '.join(map(str, o)))
bool_out = lambda o: out('YES' if o else 'NO')
tests = lambda : range(1, int_in() + 1)
from math import pi, tan

def solve(n):
	radians = pi / (2 * n)
	return 1 / tan(radians)
for i in tests():
	out(solve(int_in()))


import math
t = int(input())
while t > 0:
	n = int(input())
	l = 4 * n
	b = 360 / l
	k = math.radians(b)
	print(1 / math.tan(k))
	t -= 1


import math
n = int(input())
while n > 0:
	d = int(input())
	d = d * 2
	l = 22 / 7
	k = math.sin(3.141592 / (2 * d))
	k = 1 / (2 * k)
	print(k)
	n -= 1


t = int(input())
import math
for i in range(t):
	n = int(input())
	p = math.pi
	denom = math.sqrt(2) * math.sin(p / (2 * n))
	up = math.sin(p * ((n + 1) / 2) / (2 * n)) + math.sin(p * ((n - 1) / 2) / (2 * n))
	print(up / denom)


import math
import sys
input = sys.stdin.readline
(T,) = map(int, input().split())
for t in range(T):
	n = int(input())
	print(math.cos(math.pi / (4 * n)) / math.sin(math.pi / (2 * n)))


import sys
from math import pi, cos
TEST = 0
if TEST == 1:
	input_file = open('inputC.txt', 'r')
	input_from_file = input_file.readlines()

def read_int():
	if TEST:
		return int(input_from_file.pop(0))
	else:
		return int(sys.stdin.readline())

def read_ints():
	if TEST:
		return list(map(int, input_from_file.pop(0).rstrip().split()))
	else:
		return list(map(int, sys.stdin.readline().split()))
t = read_int()
for test in range(t):
	n = read_int()
	alpha = (n - 1) / n * 180
	steps = int((n - 2) / 2)
	beta = 0
	half_side = 0.5
	for k in range(steps):
		beta = 90 - (alpha - 90 - beta)
		half_side += cos(beta * pi / 180)
	print(2 * half_side)


import math
t = int(input())
for _ in range(t):
	n = int(input())
	print(math.cos(math.radians(90) / (2 * n)) / math.sin(math.radians(90) / n))


from math import radians, sin, cos, sqrt, tan
for tt in range(int(input())):
	n = int(input())
	n2 = n
	n = n * 2
	ok = 360 / n * (n2 // 2)
	ok = (90 - ok) / 2
	ok = radians(ok)
	t = 1 / (2 * sin(radians(180 / n)))
	val = cos(ok) * 2 * t
	print(val)


import math
for _ in range(int(input())):
	n = int(input())
	rad = math.radians(90 * (1 - 1 / n))
	print(math.tan(rad) + 1e-10)


from math import *
exec(int(input()) * 'print(1/(2*sin(pi/(4*int(input())))))\n')


import math

def main():
	for _ in range(int(input())):
		n = int(input())
		a = math.pi / 2
		y = math.tan(a / n)
		print(1 / y)
main()


import math
for _ in range(int(input())):
	x = int(input())
	n = 2 * x
	radius = 1 / math.sin(math.pi / n)
	side = radius * math.cos(math.pi / n)
	print(side)


import sys
import math
input = sys.stdin.readline
for _ in range(int(input())):
	N = int(input())
	n = 2 * N
	piee = math.pi
	result = math.cos(piee / n) / math.sin(piee / n)
	print(result)


ipnl = lambda n: [int(input()) for _ in range(n)]
inp = lambda : int(input())
ip = lambda : [int(w) for w in input().split()]
import math
for _ in range(inp()):
	n = inp()
	d = 1 / math.sin(math.pi / (2 * n))
	r = d / 2
	ans = 2 * math.sqrt(r ** 2 - 0.25)
	print(ans)


import math
T = int(input())

def ans(n):
	r = 1 / (2 * math.sin(math.pi / (2 * n)))
	if n % 2 == 1:
		return 2 * r * math.cos(math.pi / (4 * n))
	return 2 * math.sqrt(r * r - 0.25)
for t in range(T):
	n = int(input())
	print(ans(n))


from math import *
t = int(input())
for case in range(t):
	n = int(input())
	diam = 1 / sin(pi / (2 * n))
	theta = ((n // 2 + 1) * pi / n - pi / 2) / 2
	print(diam * cos(theta))


import math

def main():
	for q in range(int(input())):
		N = int(input())
		deg = 180 - 360 / (2 * N)
		deg /= 2
		deg = math.pi * deg / 180
		print(math.tan(deg))
main()


import math
t = int(input())
for _ in range(t):
	p = math.pi
	n = 2 * int(input())
	if n // 2 == 2:
		ans = 1
	else:
		ans = 1.0 / math.sin(math.radians(180 / n))
		ans = (ans ** 2 - 1) ** 0.5
	print('{:.7f}'.format(ans))


import math as mt
import sys, string
input = sys.stdin.readline
from collections import defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
t = I()
for _ in range(t):
	n = I()
	d = 90 / n * (mt.pi / 180)
	print(mt.cos(d) / mt.sin(d))


import sys
input = sys.stdin.readline

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def upper_bound(a, x, lo=0, hi=None):
	if hi == None:
		hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
from itertools import permutations
import math

def solve():
	n = int(input())
	angle = 2 * math.pi / (2 * n)
	angle /= 2
	x = 0.5 / math.sin(angle)
	print('{:.9f}'.format(x * math.cos(angle) * 2))
for _ in range(int(input())):
	solve()


import math
t = eval(input())
for i in range(t):
	n = eval(input())
	len = 2 * n
	ans = 1 / math.sin(math.radians(180.0 / len)) * math.cos(math.radians(180.0 / len))
	print(ans)


import sys
import math
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	p = math.tan(math.pi / (2 * n))
	print(1 / p)


from __future__ import division, print_function
import sys
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
if os.path.exists('out.txt'):
	sys.stdout = open('out.txt', 'w')

def input():
	return sys.stdin.readline()

def mapi(arg=0):
	return map(int if arg == 0 else str, input().split())
from math import *
for _ in range(int(input())):
	n = int(input())
	l = 0
	r = pi / (4 * n)
	res = float('inf')
	while r - l > 1e-09:
		mid1 = l + (r - l) / 3
		mid2 = mid1 + (r - l) / 3
		a = cos(mid1) / sin(pi / (2 * n))
		b = cos(mid2) / sin(pi / (2 * n))
		res = min(res, a, b)
		if a < b:
			r = mid2
		else:
			l = mid1
	print(res)


from math import *
for i in range(int(input())):
	n = 2 * int(input())
	print(round(1 / tan(pi / n), 9))


from math import factorial as fac
from collections import defaultdict
from copy import deepcopy
import sys, math
f = None
try:
	f = open('q1.input', 'r')
except IOError:
	f = sys.stdin
if 'xrange' in dir(__builtins__):
	range = xrange

def print_case_iterable(case_num, iterable):
	print('Case #{}: {}'.format(case_num, ' '.join(map(str, iterable))))

def print_case_number(case_num, iterable):
	print('Case #{}: {}'.format(case_num, iterable))

def print_iterable(A):
	print(' '.join(A))

def read_int():
	return int(f.readline().strip())

def read_int_array():
	return [int(x) for x in f.readline().strip().split(' ')]

def rns():
	a = [x for x in f.readline().split(' ')]
	return (int(a[0]), a[1].strip())

def read_string():
	return list(f.readline().strip())
NUMBER = 10 ** 9 + 7

def factorial(n):
	M = NUMBER
	f = 1
	for i in range(1, n + 1):
		f = f * i % M
	return f

def mult(a, b):
	return a * b % NUMBER

def minus(a, b):
	return (a - b) % NUMBER

def plus(a, b):
	return (a + b) % NUMBER

def egcd(a, b):
	if a == 0:
		return (b, 0, 1)
	else:
		(g, y, x) = egcd(b % a, a)
		return (g, x - b // a * y, y)

def modinv(a):
	m = NUMBER
	(g, x, y) = egcd(a, m)
	if g != 1:
		raise Exception('modular inverse does not exist')
	else:
		return x % m
from collections import deque, defaultdict
import heapq

def bfs(V, E):
	s = set()
	num_connected_components = 0
	for v in V:
		if v in s:
			continue
		q = deque([])
		s.add(v)
		q.append(v)
		while len(q) > 0:
			x = q.popleft()
			for e in E[x]:
				if e not in s:
					s.add(e)
					q.append(e)
		num_connected_components += 1
	return num_connected_components

def bfs_get_neig(V, get_neig):
	s = set()
	num_connected_components = 0
	for v in V:
		if v in s:
			continue
		q = deque([])
		s.add(v)
		q.append(v)
		while len(q) > 0:
			x = q.popleft()
			for e in get_neig(*x):
				if e not in s:
					s.add(e)
					q.append(e)
		num_connected_components += 1
	return num_connected_components

def binary_count_smaller(L, x):
	l = 0
	if x < L[0]:
		return 0
	r = len(L)
	while r - l > 1:
		mid = (l + r) // 2
		if L[mid] < x:
			l = mid
		else:
			r = mid
	return l + 1

def binary_count_larger(L, x):
	l = 0
	if x > L[-1]:
		return 0
	r = len(L)
	while r - l > 1:
		mid = (l + r) // 2
		if L[mid] <= x:
			l = mid
		else:
			r = mid
	return len(L) - (r - 1)

def regular_bs(L, x, l=None, r=None):
	l = 0 if l == None else l
	r = len(L) if r == None else r
	while r - l > 1:
		m = (r + l) // 2
		l = m if L[m] <= x else l
		r = m if L[m] > x else r
	cnt = 0
	return l
from itertools import product

def preprocess():
	nums = dict(zip(sequences, range(10)))
	changes = defaultdict(dict)
	for comb in map(lambda x: ''.join(x), product(*[['0', '1']] * 7)):
		for seq in sequences:
			a = int(comb, 2)
			b = int(seq, 2)
			num_changes = bin(a ^ b).count('1')
			if num_changes == seq.count('1') - comb.count('1'):
				changes[comb][num_changes] = nums[seq]
	return changes
from collections import deque
from itertools import product

def bi(x):
	return bin(x)[2:]

def check_no_ghg_row(matrix, n, m):
	for i in range(n):
		black = False
		white = False
		for x in matrix[i]:
			if x == '.' and (not black or white):
				continue
			if x == '#' and black and white:
				return False
			if x == '#' and black:
				continue
			if x == '.' and black:
				white = True
			if x == '#':
				black = True
	return True

def check_no_ghg_col(matrix, n, m):
	for j in range(m):
		black = False
		white = False
		for i in range(n):
			x = matrix[i][j]
			if x == '.' and (not black or white):
				continue
			if x == '#' and black and white:
				return False
			if x == '#' and black:
				continue
			if x == '.' and black:
				white = True
			if x == '#':
				black = True
	return True

def empty_col(matrix, n, m):
	for j in range(m):
		empty = True
		for i in range(n):
			if matrix[i][j] == '#':
				empty = False
				break
		if empty:
			return True
	return False

def empty_row(matrix, n, m):
	for i in range(n):
		empty = True
		for j in range(m):
			if matrix[i][j] == '#':
				empty = False
				break
		if empty:
			return True
	return False

def find_lcm(num1, num2):
	if num1 > num2:
		num = num1
		den = num2
	else:
		num = num2
		den = num1
	rem = num % den
	while rem != 0:
		num = den
		den = rem
		rem = num % den
	gcd = den
	lcm = int(int(num1 * num2) / int(gcd))
	return lcm

def find_lcm_array(A):
	if len(A) == 1:
		return A[0]
	lcm = find_lcm(A[0], A[1])
	for i in range(2, len(A)):
		lcm = find_lcm(lcm, A[i])
	return lcm

def solution(n):
	n = 2 * n
	return math.tan(math.pi * (n - 2) / (2 * n))

def main():
	T = read_int()
	for i in range(T):
		n = read_int()
		x = solution(n)
		if 'xrange' not in dir(__builtins__):
			print(x)
		else:
			(print >> output, str(x))
	if 'xrange' in dir(__builtins__):
		print(output.getvalue())
		output.close()
if 'xrange' in dir(__builtins__):
	import cStringIO
	output = cStringIO.StringIO()
main()


import sys
import math
from collections import deque, defaultdict as dd
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd, pi

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def read():
	tc = 0
	if tc:
		input = sys.stdin.readline
	else:
		sys.stdin = open('input1.txt', 'r')
		sys.stdout = open('output1.txt', 'w')

def solve():
	for _ in range(ii()):
		n = ii()
		n *= 2
		x = pi / n
		y = math.tan(pi / n)
		print(1 / y)
solve()


import math
t = int(input())
for _ in range(t):
	n = int(input())
	n = n * 2
	n = 3.141592653589793 / n
	ans = math.tan(n)
	a = 1.0 / ans
	print('%.10f' % a)


import math
t = int(input())
for i in range(t):
	n = int(input()) * 2
	a = (n - 2) / n * 180
	r = 1 / (2 * math.tan(math.pi / n))
	print('%.7f' % (r * 2))


from math import tan, pi
test = int(input())
for i in range(test):
	x = int(input())
	x *= 2
	print(1 / tan(pi / x))


import math
t = int(input())
for ii in range(t):
	n = int(input())
	r = 1 / (2 * math.tan(math.pi / (2 * n)))
	print(2 * r)


import math

def solve():
	n = int(input())
	if n == 2:
		print(1.0)
		return
	n *= 2
	angle = 3.14159265 / n
	v = math.tan(angle)
	r = 0.5 / v
	print(2 * r)
	return
t = 1
t = int(input())
while t > 0:
	t -= 1
	solve()


def rs():
	return input().strip()

def ri():
	return int(input())

def ria():
	return list(map(int, input().split()))

def ia_to_s(a):
	return ' '.join([str(s) for s in a])
from math import pi, sin, cos

def solve(n):
	return cos(pi / (4 * n)) / sin(pi / (2 * n))

def main():
	for _ in range(ri()):
		n = ri()
		print(solve(n))
main()


from math import pi
import math

def fun(n):
	s = 1
	for i in range(1, int(n / 2) + 1):
		s += 2 * math.cos(pi * i / n)
	return s
t = int(input())
for i in range(t):
	n = int(input())
	print(fun(n))


import os
import sys
from io import BytesIO, IOBase
import math

def inputIntArray():
	return list(map(int, input().rstrip().split()))

def inputArray():
	return input().rstrip().split()

def inputVars():
	return map(int, input().rstrip().split())

def inputNum():
	return int(input())

def main():
	PI = math.pi
	for _ in range(inputNum()):
		n = inputNum() * 2
		res = math.cos(PI / (2 * n)) / math.sin(PI / n)
		print(res)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import math
t = int(input())
for q in range(t):
	n = int(input())
	x = 0.5 / math.tan(math.pi / (2 * n))
	print(2 * x)


import sys
import os
import heapq
import math
try:
	path = './file/input.txt'
	if os.path.exists(path):
		sys.stdin = open(path, 'r')
except:
	pass
t = int(input())

def printd(value):
	pass

def case():
	n = int(input())
	ang = 360 / (2 * n)
	x = 0.5 / math.sin(math.radians(ang / 2))
	ang2 = round(n / 4) * ang
	ang1 = 90 - ang2
	ans1 = math.sin(math.radians(ang1)) * x / math.sin(math.radians(45))
	ans2 = math.sin(math.radians(ang2)) * x / math.sin(math.radians(45))
	print(ans1 + ans2)
for _ in range(t):
	case()


import sys
import math
for _ in range(int(input())):
	n = int(sys.stdin.readline())
	print(math.tan(math.radians((180 - 360 / (2 * n)) / 2)))


import math
for _ in range(int(input())):
	n = int(input())
	n += n
	ans = 1
	k = (n - 4) // 4
	an = math.pi * (n - 2) / n
	j = math.pi / 2
	p = 0
	for i in range(k):
		l = an - j - p
		ans += 2 * math.cos(l)
		p = j - l
	print(ans)


import math
t = int(input())
for i in range(t):
	n = float(input())
	n *= 2
	res = math.cos(math.pi / (2 * n)) / math.sin(math.pi / n)
	print(res)


from sys import stdin
from math import tan, radians
for t in range(int(stdin.readline())):
	n = int(input())
	print(abs(1 / tan(radians(90) / n)))


import math
for q in range(int(input())):
	n = int(input())
	n = 2 * n
	angle = (n - 2) * 180 / n / 2
	ans = math.tan(math.radians(angle))
	print(ans)


import math

def solve(n):
	if n == 2:
		return 1.0
	each_angle = math.pi / n
	height = 0
	width = 0
	for i in range(n):
		angle = each_angle * i
		height += math.sin(angle) * 1.0
		width += abs(math.cos(angle)) * 1.0
	if width > height:
		sectors = n // 2
		angle = each_angle * (0.5 + sectors / 2) - math.pi / 4
		ans = width * math.cos(angle)
	else:
		ans = height
	return ans

def main():
	T = int(input())
	for _ in range(1, T + 1):
		n = int(input())
		print(solve(n))
main()


import math
import sys
input = sys.stdin.readline
T = int(input())
for i in range(T):
	n = int(input())
	theta = math.radians(45 / n)
	print(math.cos(theta) / math.sin(2 * theta))


from math import sin, pi, sqrt
for _ in range(int(input())):
	n = int(input())
	print(round(1 / (2 * sin(pi / 4 / n)), 9))


from __future__ import division, print_function
from sys import stdin, stdout
import bisect
import math
import heapq
i_m = 9223372036854775807

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())
import math

def GCD(x, y):
	x = abs(x)
	y = abs(y)
	if min(x, y) == 0:
		return max(x, y)
	while y:
		(x, y) = (y, x % y)
	return x

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l
prime = []

def SieveOfEratosthenes(n):
	global prime
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	f = []
	for p in range(2, n):
		if prime[p]:
			f.append(p)
	return f
q = []

def dfs(n, d, v, c):
	global q
	v[n] = 1
	if n not in d:
		return v
	x = d[n]
	q.append(n)
	j = c
	for i in x:
		if i not in v:
			v = dfs(i, d, v, c + 1)
	return v

def main():
	t = inin()
	for _ in range(t):
		n = inin()
		n = 2 * n
		print(1 / math.tan(math.pi / n))
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def readnumbers(zero=0):
	conv = ord if py2 else lambda x: x
	A = []
	numb = zero
	sign = 1
	i = 0
	s = sys.stdin.buffer.read()
	try:
		while True:
			if s[i] >= b'R'[0]:
				numb = 10 * numb + conv(s[i]) - 48
			elif s[i] == b'-'[0]:
				sign = -1
			elif s[i] != b'\r'[0]:
				A.append(sign * numb)
				numb = zero
				sign = 1
			i += 1
	except:
		pass
	if s and s[-1] >= b'R'[0]:
		A.append(sign * numb)
	return A
main()


from math import sin, cos, pi
t = int(input())
for th in range(t):
	n = int(input())
	print(cos(pi / (4 * n)) / sin(pi / (2 * n)))


from math import tan, radians, sqrt, pi
for T in range(int(input())):
	n = int(input())
	if n == 2:
		print(str(1.0) + '0' * 9)
	else:
		angle = (2 * n - 2) * 180 / (2 * n)
		rad = radians(angle / 2)
		k = tan(rad)
		d = 1 / 2 * k
		print(round(k, 9))


from math import tan, sin, cos, pi
t = 1
t = int(input())
for i in range(t):
	PI = pi
	a = int(input())
	print(cos(PI / (4 * a)) / sin(PI / (2 * a)))


import math
T = int(input())
for _ in range(T):
	N = int(input())
	v1 = complex(1, 0)
	angle = N // 2 * (math.pi / N)
	v2 = complex(math.cos(angle), math.sin(angle))
	print(math.sqrt(2) * 0.5 * (abs(v1 + v2) + abs(v1 - v2)) * (1 / (2 * math.sin(math.pi / (2 * N)))))


import math
t = int(input())
for i in range(t):
	n = int(input())
	x = math.pi / n
	y = math.tan(x / 2)
	b = float(0.5 / y)
	print(float(2) * b)


import random
import math
LI = lambda : list(map(int, input().split()))
MI = lambda : map(int, input().split())
yes = lambda : print('Yes')
no = lambda : print('No')
I = lambda : list(input())
J = lambda x: ''.join(x)
II = lambda : int(input())
SI = lambda : input()
t = II()
for q in range(t):
	n = II()
	R = 1 / (2 * math.sin(math.pi / (2 * n)))
	r = math.sqrt(R ** 2 - 0.25)
	print(2 * r)


from collections import defaultdict
import math

def main():
	for _ in range(int(input())):
		n = int(input())
		s = 0
		m = math.pi - math.pi * (2 * n - 2) / (2 * n)
		for i in range(n // 2 - 1):
			s += math.sin(m)
			m = m + math.pi - math.pi * (2 * n - 2) / (2 * n)
		print(1.0 + 2.0 * s)
main()


from math import cos, pi
t = int(input())
for i in range(t):
	n = int(input())
	theta = pi / n
	maxX = 0
	currX = 0
	for i in range(n // 2 + 1):
		currX += cos(theta * (i + 1))
		maxX = max(currX, maxX)
	ans = 1 + 2 * maxX
	print(ans)


from math import *
for _ in range(int(input())):
	n = int(input())
	print(1 / (2 * sin(pi / (4 * n))))


from math import pi, cos
t = int(input())
for _ in range(t):
	n = int(input())
	n *= 2
	rot = 2 * pi / n
	ini = pi
	ans = 0
	for i in range(n // 2 - 1):
		ini -= rot
		ans += abs(cos(ini))
	print(ans + 1)


from math import radians, tan
T = int(input())
for t in range(T):
	n = 2 * int(input())
	print(1 / tan(radians(180 / n)))


from math import *
for s in [*open(0)][1:]:
	print(1 / tan(pi / 2 / int(s)))


import math as jb
for i in range(0, int(input())):
	n = int(input())
	if n == 2:
		print(1.0)
	else:
		print(jb.tan((0.5 - 1 / (n * 2)) * jb.pi))


from sys import stdin, stdout
import heapq as hq
from collections import defaultdict
from math import pi, tan
t = int(input())
for tc in range(t):
	n = int(stdin.readline())
	w = 2 * (0.5 * tan(2 * pi / (4 * n)) ** (-1))
	stdout.write(str(w) + '\n')


from math import tan, pi
cases = int(input())
for _ in range(cases):
	n = int(input())
	r = 2 * n
	x = tan(pi / r)
	if n == 2:
		print(r / (4 * x))
	else:
		print(r / (4 * x) / (n // 2))


import math
t = int(input())
for ii in range(t):
	n = int(input())
	alpha = 360 / (2 * n)
	k = 1
	while alpha * (k + 1) / 2 < 45:
		k += 2
	r = 1 / (2 * math.sin(math.pi / (2 * n)))
	beta = alpha * k * math.pi / 180
	print((r * math.cos(beta / 2) * 2 + r * math.sin(beta / 2) * 2) / math.sqrt(2))


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return [int(i) for i in input().split()]

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)
for _ in range(ii()):
	print(1 / (2 * math.sin(math.pi / (4 * ii()))))


import math

def solution(n):
	area = 1 / math.tan(math.pi / 2 / n)
	return area
tc = int(input())
for i in range(tc):
	n = int(input())
	print(solution(n))


from math import gcd, ceil, sin, radians, cos
from collections import defaultdict as dd

def lcm(a, b):
	return a * b // gcd(a, b)

def inin():
	return int(input())

def inar():
	return list(map(int, input().split()))

def ar(element, size):
	return [element for i in range(size)]

def digitsum(num):
	su = 0
	while num:
		su += num % 10
		num //= 10
	return su

def yes():
	print('YES')

def no():
	print('NO')
Testcase = inin()
for _ in range(Testcase):
	n = inin()
	n = 2 * n
	ans = cos(radians(180 / n)) / (2 * sin(radians(180 / n)))
	print(2 * ans)


from math import pi, tan
t = int(input())
for _ in range(t):
	n = int(input())
	deg = pi / 2 - pi / (2 * n)
	print(round(tan(deg), 9))


import math as mt
for _ in range(int(input())):
	n = 2 * int(input())
	print(1 / mt.sin(float(3.141592653) / (n * 2)) / 2)


import math
for i in range(int(input())):
	sides = 2 * int(input())
	radius = 1 / (2 * math.sin(math.pi / sides))
	length = 1
	angle_count = 1
	angle = 2 * math.pi / sides
	orig_angle = angle
	while angle < math.pi / 2:
		length += 2 * math.cos(angle)
		angle += orig_angle
	print(length)


import math as m
for i in range(int(input())):
	n = int(input())
	x = 0.5 / m.tan(m.pi / (2 * n))
	print(2 * x)


import sys
import math
strInp = lambda : input().strip().split()
intInp = lambda : list(map(int, strInp()))
for i in range(int(input())):
	n = int(input())
	tany = math.tan(math.pi / (2 * n))
	print(1 / tany)


import sys
from math import pi, sin, cos
input = sys.stdin.readline
for _ in range(int(input())):
	N = int(input())
	l = 1 / sin(pi / N)
	arg = pi * (N - 2) / N
	x0 = 0
	x1 = 0
	x2 = 0
	x3 = pi / 2 - arg / 2
	while x3 - x0 > pow(0.1, 10):
		x1 = (x0 * 2 + x3) / 3
		x2 = (x0 + x3 * 2) / 3
		r1 = max(cos(x1), cos(pi / 2 + x1))
		r2 = max(cos(x2), cos(pi / 2 + x2))
		if r1 > r2:
			x0 = x1
		else:
			x3 = x2
	print(l + cos(x1) * l)


import sys
import math
read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
t = int(input())
for case in range(t):
	n = int(input())
	print(1 / math.tan(math.radians(180 / (2 * n))))


import math
n = int(input())
while n != 0:
	n -= 1
	x = int(input())
	theta = math.pi / x
	radius = 1 / (2 * math.sin(theta / 2))
	print((math.sin(theta * (x // 2 + 1) * 0.5) + math.sin(theta * (x // 2) * 0.5)) * radius * math.sqrt(2))


t = int(input())
i = 0
import math
while i < t:
	n = int(input())
	q = math.pi / (2 * n)
	s = 1 / math.tan(q)
	print(round(s, 16))
	i = i + 1


import math
for _ in range(int(input())):
	n = int(input())
	ans = 1 / math.tan(3.14159265359 / (2 * n))
	print(ans)


from bisect import *
from collections import *
from math import gcd, ceil, sqrt, floor, inf
from heapq import *
from itertools import *
from operator import add, mul, sub, xor, truediv, floordiv
from functools import *
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())
from types import GeneratorType

def bootstrap(f, stack=[]):

	def wrappedfunc(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		else:
			to = f(*args, **kwargs)
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						break
					to = stack[-1].send(to)
			return to
	return wrappedfunc
farr = [1]
ifa = []

def fact(x, mod=0):
	if mod:
		while x >= len(farr):
			farr.append(farr[-1] * len(farr) % mod)
	else:
		while x >= len(farr):
			farr.append(farr[-1] * len(farr))
	return farr[x]

def ifact(x, mod):
	global ifa
	ifa.append(pow(farr[-1], mod - 2, mod))
	for i in range(x, 0, -1):
		ifa.append(ifa[-1] * i % mod)
	ifa = ifa[::-1]

def per(i, j, mod=0):
	if i < j:
		return 0
	if not mod:
		return fact(i) // fact(i - j)
	return farr[i] * ifa[i - j] % mod

def com(i, j, mod=0):
	if i < j:
		return 0
	if not mod:
		return per(i, j) // fact(j)
	return per(i, j, mod) * ifa[j] % mod

def catalan(n):
	return com(2 * n, n) // (n + 1)

def isprime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True

def lowbit(n):
	return n & -n

def inverse(a, m):
	a %= m
	if a <= 1:
		return a
	return (1 - inverse(m, a) * m) // a % m

class BIT:

	def __init__(self, arr):
		self.arr = arr
		self.n = len(arr) - 1

	def update(self, x, v):
		while x <= self.n:
			self.arr[x] += v
			x += x & -x

	def query(self, x):
		ans = 0
		while x:
			ans += self.arr[x]
			x &= x - 1
		return ans

class DSU:

	def __init__(self, n):
		self.c = [-1] * n

	def same(self, x, y):
		return self.find(x) == self.find(y)

	def find(self, x):
		if self.c[x] < 0:
			return x
		self.c[x] = self.find(self.c[x])
		return self.c[x]

	def union(self, u, v):
		(u, v) = (self.find(u), self.find(v))
		if u == v:
			return False
		if self.c[u] < self.c[v]:
			(u, v) = (v, u)
		self.c[u] += self.c[v]
		self.c[v] = u
		return True

	def size(self, x):
		return -self.c[self.find(x)]

class UFS:

	def __init__(self, n):
		self.parent = [i for i in range(n)]
		self.ranks = [0] * n

	def find(self, x):
		if x != self.parent[x]:
			self.parent[x] = self.find(self.parent[x])
		return self.parent[x]

	def union(self, u, v):
		(pu, pv) = (self.find(u), self.find(v))
		if pu == pv:
			return False
		if self.ranks[pu] >= self.ranks[pv]:
			self.parent[pv] = pu
			if self.ranks[pv] == self.ranks[pu]:
				self.ranks[pu] += 1
		else:
			self.parent[pu] = pv

def Prime(n):
	c = 0
	prime = []
	flag = [0] * (n + 1)
	for i in range(2, n + 1):
		if not flag[i]:
			prime.append(i)
			c += 1
		for j in range(c):
			if i * prime[j] > n:
				break
			flag[i * prime[j]] = prime[j]
			if i % prime[j] == 0:
				break
	return flag

def dij(s, graph):
	d = {}
	d[s] = 0
	heap = [(0, s)]
	seen = set()
	while heap:
		(dis, u) = heappop(heap)
		if u in seen:
			continue
		for v in graph[u]:
			if v not in d or d[v] > d[u] + graph[u][v]:
				d[v] = d[u] + graph[u][v]
				heappush(heap, (d[v], v))
	return d

def GP(it):
	return [[ch, len(list(g))] for (ch, g) in groupby(it)]

class DLN:

	def __init__(self, val):
		self.val = val
		self.pre = None
		self.next = None

def nb(i, j):
	for (ni, nj) in [[i + 1, j], [i - 1, j], [i, j - 1], [i, j + 1]]:
		if 0 <= ni < n and 0 <= nj < m:
			yield (ni, nj)

@bootstrap
def gdfs(r, p):
	if len(g[r]) == 1 and p != -1:
		yield None
	for ch in g[r]:
		if ch != p:
			yield gdfs(ch, r)
	yield None
from math import pi, tan, sin
t = N()
for i in range(t):
	n = N()
	a = pi * (n + 1) / (n * 4)
	d = 0.5 / sin(pi / (2 * n))
	ans = 2 * sin(a + pi / 4) * d
	print(ans)


import math
cases = int(input())
for z in range(cases):
	num = int(input())
	val = math.tan(math.pi / (2 * num))
	print(1 / val)


import math
t = int(input())
for _ in range(t):
	n = 2 * int(input())
	sumi = 0
	crntangle = 180 - (n - 2) * 180 / n
	sumi += math.cos((180 - (n - 2) * 180 / n) * (math.pi / 180))
	for i in range(n // 4 - 1):
		crntangle = crntangle + (180 - 180 * (n - 2) / n)
		sumi = sumi + math.cos(crntangle * (math.pi / 180))
	print(2 * sumi + 1)


import math
T = int(input())
while T != 0:
	n = int(input())
	side = math.sin(math.pi / (4 * n)) * 2
	print(1 / side)
	T -= 1


import math
for lo in range(int(input())):
	n = int(input())
	n = 2 * n
	a = math.pi / 2 - math.pi / n
	h = math.tan(a)
	print(str(round(h, 9)))


import math

def sqare_size(n):
	return 1 / math.tan(math.pi / (2 * n))
t = int(input())
for _ in range(t):
	print(sqare_size(int(input())))


import math
t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	angle = math.pi / n
	height = 0.0
	itercount = int((n - 2) / 2)
	for i in range(itercount):
		height = height + math.cos(angle)
		angle = angle + math.pi / n
	print(1 + 2 * height)


import math
t = int(input())
for x in range(0, t):
	n = int(input())
	d = 2 * n
	dev = 360 / d
	ans = 0
	p = math.pi
	te = math.log(n, 2)
	ans = 1 / abs(math.sin(p / (2 * d)))
	print(ans / 2)


import math
t = int(input())
for i in range(t):
	n = int(input())
	s = 0.5
	A = (2 * n - 2) * math.pi / (2 * n)
	theta = A - math.pi / 2
	for j in range((n - 2) // 2):
		s += math.sin(theta)
		theta = A + theta - math.pi
	print(2 * s)


import sys, math
max_int = 1000000001
min_int = -max_int
t = int(input())
for _t in range(t):
	n = int(sys.stdin.readline())
	alpha = math.pi / (2 * n)
	print(1 / math.tan(alpha))


import math

def sol(n):
	n = n // 2
	a = 360 / (4 * n)
	s = 1
	for x in range(1, n):
		s += 2 * math.cos(math.radians(a * x))
	return s
t = int(input())
for _ in range(t):
	s = int(input())
	v = sol(s)
	print(v)


import math as m
for i in range(int(input())):
	n = int(input())
	x = m.cos(m.pi / (4 * n))
	y = m.sin(m.pi / (2 * n))
	print(x / y)


import sys
input = lambda : sys.stdin.readline().rstrip()
import math
from collections import deque
from queue import LifoQueue
from math import tan

def apothem(n):
	return 1 / (2 * tan(180 / n * 3.141592653589793 / 180))
for _ in range(int(input())):
	n = int(input())
	print(2 * apothem(2 * n))


import math
q = int(input())
for _ in range(q):
	n = int(input())
	alfa = 3 * math.pi / 4 - n // 2 * math.pi / (2 * n)
	y = math.tan(math.pi / 2 - math.pi / (2 * n))
	x = y / math.cos(math.pi / (2 * n))
	bok = math.sin(alfa) * x
	print(bok)


from math import tan, pi
for t in range(int(input().strip())):
	v = int(input().strip())
	print(1 / tan(pi / (2 * v)))


import math

def main():
	T = int(input())
	for t in range(T):
		n = int(input()) * 2
		R = 1.0 / 2.0 / math.sin(math.pi / n)
		h = math.sqrt(R * R - 0.5 * 0.5)
		print(2 * h)
main()


import math
for i in range(int(input())):
	a = int(input()) * 2
	if a == 4:
		print(2 / 2)
	else:
		k = 360 / a
		k = k / 2
		k = math.radians(k)
		k = math.tan(k)
		k = 1 / k
		print(k)


import sys
import heapq
import math
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
input = sys.stdin.readline
for i in range(int(input())):
	a = int(input())
	b = math.pi / a
	w = b
	q = 0
	for i in range(a - 1):
		q += math.sin(w)
		w += b
	print(q)


import math
t = int(input())
for i in range(t):
	n = int(input())
	print(1 / math.tan(math.radians(90 / n)))


from math import sin, pi
t = int(input())
while t != 0:
	t -= 1
	n = int(input())
	k = 1 / (2 * sin(pi / (2 * n)))
	r = k ** 2 - 0.5 ** 2
	r = r ** 0.5
	print(r * 2)


from math import *
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(1 / tan(radians(90 / n)))


import math
import sys

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return list(map(int, input().split()))
test_cases = int(input())
for _ in range(test_cases):
	sides = int(input())
	sides *= 2
	apothem = 1 / (2 * math.tan(180 / sides * (math.pi / 180)))
	print(2 * apothem)


from math import pi, sin, cos
T = int(input().strip())
for t in range(T):
	n = int(input().strip())
	alpha = pi / n
	R = 1 / (2 * sin(alpha / 2))
	if n % 2 == 0:
		gamma = alpha / 2
	else:
		k = n // 2
		gamma = pi / 2 - alpha * k
	res = R * 2 * cos(gamma)
	print(res)


from math import tan
from math import pi

def f(n):
	return 1 / tan(pi / (2 * n))
t = int(input())
for i in range(t):
	n = int(input())
	print(f(n))


import bisect
import collections
import copy
import enum
import functools
import heapq
import itertools
import math
import random
import re
import sys
import time
import string
from typing import List
sys.setrecursionlimit(3001)
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	angel = math.pi / (2 * n)
	d3 = 1 / math.tan(angel)
	print(d3)


from __future__ import division, print_function
import itertools
import sys
import os
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	input = raw_input
	range = xrange
	filter = itertools.ifilter
	map = itertools.imap
	zip = itertools.izip

def is_it_local():
	script_dir = str(os.getcwd()).split('/')
	username = 'dipta007'
	return username in script_dir

def READ(fileName):
	if is_it_local():
		sys.stdin = open(f'./{fileName}', 'r')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
if not is_it_local():
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
	input = lambda : sys.stdin.readline().rstrip('\r\n')

def input1(type=int):
	return type(input())

def input2(type=int):
	[a, b] = list(map(type, input().split()))
	return (a, b)

def input3(type=int):
	[a, b, c] = list(map(type, input().split()))
	return (a, b, c)

def input_array(type=int):
	return list(map(type, input().split()))

def input_string():
	s = input()
	return list(s)
import math

def get_r(deg):
	r = math.sqrt(1 / (2 - 2 * math.cos(math.radians(deg))))
	return r

def main():
	t = input1()
	for ci in range(t):
		n = input1()
		n = n * 2
		deg = 360 / n
		r = get_r(deg)
		d = r + r
		res = math.sqrt(d * d - 1)
		print(res)
	pass
READ('in.txt')
main()


import math
T = int(input())
for t in range(T):
	n = int(input()) * 2
	print(1 + 2 * sum([math.cos(2 * math.pi * k / n) for k in range(1, n // 4)]))


import math
t = int(input())
for test in range(t):
	n = int(input())
	x = 2 * math.pi / 360
	d = 360 / (4 * n)
	denom = math.tan(d * x)
	print(1 / denom)


import math
t = int(input())
while t > 0:
	n = int(input())
	x = math.radians(90 * (n - 1) / n)
	print(math.tan(x))
	t = t - 1


import sys
from collections import defaultdict, deque
from math import sqrt, gcd, factorial, tan, pi, sin, cos

def input():
	return sys.stdin.readline()[:-1]

def solve():
	n = int(input())
	n *= 2
	if n == 2:
		print(1)
	else:
		print(1 / tan(pi / n))
t = 1
t = int(input())
for case in range(1, t + 1):
	ans = solve()


import math
t = int(input())
while t:
	t += -1
	n = int(input())
	d = 2 * math.sin(math.pi / (2 * n))
	t1 = 1 / d * (1 / d)
	x = (t1 - 0.25) ** 0.5
	print(2 * x)


import sys
import math
from collections import defaultdict, deque
import heapq
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	sides = 2 * n
	(st1, st2) = (1, 2)
	x = (n - 3) // 2
	st1 += x
	st2 += x
	side = 0.5 / math.sin(math.pi / sides)
	add = math.sin(st1 * math.pi / sides) + math.sin(st2 * math.pi / sides)
	add = add * math.sqrt(2)
	ans = add * side
	print(ans)


import sys
import math
input = sys.stdin.readline
flush = sys.stdout.flush
for _ in range(int(input())):
	n = int(input())
	print(2.0 * math.cos(math.pi / (4.0 * n)) / (2.0 * math.sin(math.pi / (2.0 * n))))


import math

def solve():
	n = float(input())
	ans = 1.0
	for i in range(1, int(n / 2)):
		ans += 2 * abs(math.sin(math.radians(90 / (n / 2) * i)))
	print(ans)
t = int(input())
for _ in range(t):
	solve()


import math
for _ in range(int(input())):
	n = int(input())
	if n == 2:
		print('%.9f' % 1)
	else:
		a = 360 / (n * 4)
		ar = a * math.pi / 180
		b = 0.5 / math.tan(ar)
		print('%0.9f' % (2 * b))


import math
t = int(input())
ans_arr = []
value = math.acos(-1)
for i in range(t):
	n = int(input())
	n = 2 * n
	ans = (n - 2) * 180
	ans = ans / (n * 2)
	ans = value / 180 * (ans * 1)
	ans_arr.append(math.tan(ans))
for j in ans_arr:
	print(format(j, '.9f'))


from math import pi, sin
t = int(input())
for _ in range(t):
	n = int(input())
	print(round(0.5 / sin(pi / (4 * n)), 9))


import sys
import math
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	ans = math.cos(math.pi / (4 * n)) / math.sin(math.pi / (2 * n))
	print(ans)


from math import sin, radians

def C2(n):
	interiorangle = 360 / (2 * n)
	side = sin(radians(45))
	angle = 45
	number = (n - 1) / 2
	for i in range(int(number)):
		angle += interiorangle
		if angle > 90:
			angle = 180 - angle
			side += sin(radians(angle))
			angle = 180 - angle
		else:
			side += sin(radians(angle))
	angle = 45
	for i in range(int(number)):
		angle -= interiorangle
		if angle < 0:
			angle = -1 * angle
			side += sin(radians(angle))
			angle = -1 * angle
		else:
			side += sin(radians(angle))
	print(float(side))
a = int(input())
for _ in range(a):
	x = int(input())
	C2(x)


from math import sin, pi, sqrt, tan

def read_int():
	return int(input())

def read_ints():
	return map(int, input().split(' '))
t = read_int()
for case_num in range(t):
	n = read_int()
	angle = pi / n / 2
	r = 0.5 / sin(angle)
	a = 0
	for i in range(1, n // 2 + 1):
		A = 3 * pi / 4 - i * pi / n
		a = max(a, 2 * r * sin(A))
	print('{:.9f}'.format(a))


t = int(input())
import math
ans = [0] * t
for i in range(t):
	n = int(input())
	theta = 90 / n
	ans[i] = 1 / math.tan(math.radians(theta))
for i in range(t):
	print(format(ans[i], '.10f'))


import math
for _ in range(int(input())):
	n = int(input().strip())
	if n % 2 == 0:
		print(1 / math.tan(90 / n / 180 * math.pi))
	else:
		print(1 / 2 * math.tan(90 / n / 180 * math.pi) + 1 / 2 * math.sin(90 / n / 180 * math.pi))


import math
for i in range(int(input())):
	n = int(input())
	m = 2 * n
	print(1 / math.tan(math.pi * (1 / m)))


from math import sin, pi, cos
for _ in range(int(input())):
	n = int(input())
	curr = pi / 4
	incr = pi / n
	ans = 0
	i = 0
	mn = ans
	mx = ans
	for i in range(2 * n):
		ans += cos(curr)
		curr -= incr
		mn = min(mn, ans)
		mx = max(mx, ans)
	print('{:.9f}'.format(mx - mn))


import math
t = int(input())
for i in range(0, t):
	n = 2 * int(input())
	q = (n - 2) / n * math.pi
	print(1 / math.cos(q / 2) * math.cos(math.pi / (n * 2)))


import math
tc = int(input())
for t in range(tc):
	n = int(input()) * 2
	r2 = 1.0 / math.tan(math.pi / n)
	print(r2)


import math
T = int(input())
for _ in range(T):
	n = int(input())
	diags = 1 / math.sin(math.pi / 2 / n)
	print(diags * math.cos(math.pi / 4 / n))


import math
t = int(input())
for i in range(t):
	n = int(input()) * 2
	rad = 1 / math.sqrt(2 * (1 - math.cos(2 * math.pi / n)))
	area = 0.5 * math.sin(2 * math.pi / n) * rad * rad
	h = 2 * area
	print(2 * h)


import math
t = int(input())
for i in range(t):
	n = int(input())
	nn = 2 * n
	ang = 360 * math.pi / (2 * nn * 180)
	a = math.tan(ang)
	print(1 / a)


from sys import stdin, stdout
import math

def input():
	return stdin.readline()
t = int(input())
for _ in range(t):
	n = int(input())
	angle = math.pi / (2 * n)
	side = 1 / math.tan(angle)
	print('{:.6f}'.format(side))


import math
T = int(input())
for _ in range(0, T):
	n = int(input())
	a = 2 * n
	rr = math.pi / a
	ans = math.tan(rr)
	print(1 / ans)


import math
for t in range(int(input())):
	sides = int(input())
	N = 2 * sides
	angle = 90 - 180 / N
	rad = math.radians(angle)
	ans = math.tan(rad)
	print(ans)


import math
t = int(input())
pie = math.pi
for _ in range(t):
	n = int(input())
	an = 360 / (2 * n)
	start = (180 - an) / 2
	start = math.radians(start)
	cnt = math.tan(start) / 2
	print(2 * cnt)


class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: gcd(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from bisect import bisect_right, bisect_left
from fractions import Fraction

def pre(s):
	n = len(s)
	pi = [0] * n
	for i in range(1, n):
		j = pi[i - 1]
		while j and s[i] != s[j]:
			j = pi[j - 1]
		if s[i] == s[j]:
			j += 1
		pi[i] = j
	return pi

def prod(a):
	ans = 1
	for each in a:
		ans = ans * each
	return ans
from math import gcd

def lcm(a, b):
	return a * b // gcd(a, b)

def binary(x, length=16):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y

def pt(x, y):
	return str(x) + ',' + str(y)
from math import sin, cos, pi
for _ in range(int(input()) if True else 1):
	n = int(input())
	print(cos(pi / (2 * n)) / sin(pi / (2 * n)))


import math
tc = int(input())
for _ in range(tc):
	n = int(input())
	theta = math.pi * (1 - 1 / n) / 2
	pos1 = 1 / math.cos(theta)
	pos2 = math.tan(theta)
	print(min(pos1, pos2))


from math import *
a = int(input())
for _ in range(a):
	n = int(input())
	ang = pi / n
	x = 1 / 2 / sin(ang / 2)
	o1 = round(n / 4) * ang
	o2 = pi / 2 - o1
	ans = x / sin(pi / 4) * (sin(o1) + sin(o2))
	print(ans)


from decimal import Decimal
import math
for ii in range(int(input())):
	n = int(input())
	print(1 / math.tan(math.pi / (2 * n)))


import math
t = int(input())
for i in range(t):
	s = int(input())
	if s % 2:
		print(1 / (2 * math.sin(math.pi / (4 * s))))
	else:
		print(1 / math.tan(math.pi / s))


import math
t = int(input())
for i in range(t):
	n = int(input())
	angle = (2 * n * 180 - 360) / (2 * n)
	if n == 2:
		print(1.0)
	else:
		m = 0
		an = angle - 90
		for i in range((2 * n - 4) // 4):
			m += math.sin(math.radians(an))
			an = angle - 90 - (90 - an)
		print(math.sqrt(m ** 2 * 2) * (math.cos(math.radians(45)) * 2) + 1)


import math
PI = math.pi

def radius(n):
	return 0.5 / math.sin(PI / (2 * n))

def chord(num_sides, n):
	return 2 * radius(n) * math.sin(PI * num_sides / (2 * n))
t = int(input())
for i in range(t):
	n = int(input())
	x = int(n / 2) + 1
	y = int(n / 2)
	print(chord(x, n) / math.sqrt(2) + chord(y, n) / math.sqrt(2))


import math
import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	theta = 2 * n
	y = 1 / math.sin(math.radians(360 / 4 / n)) / 2
	p = [(0, y)]
	rot45 = ([math.cos(math.radians(45)), -math.sin(math.radians(45))], [math.sin(math.radians(45)), math.cos(math.radians(45))])
	tmp = p[-1]
	x = rot45[0][0] * tmp[0] + rot45[0][1] * tmp[1]
	y = rot45[1][0] * tmp[0] + rot45[1][1] * tmp[1]
	p[0] = (x, y)
	the = 360 / (2 * n)
	rot = ([math.cos(math.radians(the)), -math.sin(math.radians(the))], [math.sin(math.radians(the)), math.cos(math.radians(the))])
	max_x = 0
	max_y = 0
	for i in range(2 * n - 1):
		tmp = p[-1]
		x = rot[0][0] * tmp[0] + rot[0][1] * tmp[1]
		y = rot[1][0] * tmp[0] + rot[1][1] * tmp[1]
		max_x = max(abs(x), max_x)
		max_y = max(abs(y), max_y)
		p.append((x, y))
	print(2 * max_x)


def rs():
	return input().strip()

def ri():
	return int(input())

def ria():
	return list(map(int, input().split()))

def ia_to_s(a):
	return ' '.join([str(s) for s in a])
from math import pi, sin, tan

def solve(n):
	if n % 2 == 0:
		return 1.0 / tan(pi / (2 * n))
	else:
		return 1.0 / sin(pi / (2 * n))

def main():
	for _ in range(ri()):
		n = ri()
		print(solve(n))
main()


def ip():
	return int(input())

def Ip():
	return map(int, input().split())
from math import tan, pi
for _ in range(0, ip()):
	n = ip()
	a = tan(pi / (2 * n))
	x = 1 / a
	print('%.9f' % x)


import math
import sys
from collections import defaultdict, Counter, deque, OrderedDict
import bisect
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
ilele = lambda : map(int, input().split())
alele = lambda : list(map(int, input().split()))

def list2d(a, b, c):
	return [[c] * b for i in range(a)]
from itertools import accumulate, groupby

def findangle(n):
	a = (n - 2) * 180
	return a / n
for _ in range(int(input())):
	N = int(input())
	n = N * 2
	angle = findangle(n)
	ang2 = math.radians(angle / 2)
	l = math.tan(ang2) * 0.5
	print(l * 2)


from math import pi, sin, tan
for t in range(int(input())):
	n = int(input())
	theta = pi / n
	r = 1 / tan(theta / 2)
	print(r)


from sys import stdin, stdout
from math import cos, radians

def find(N):
	if N == 2:
		return 1
	A = (2 * N - 2) * 180 / (2 * N)
	X = N + 1 & ~1
	Z = A - 90
	D = Z / (X // 2 - 1)
	R = 0
	for i in range(X // 2 - 1):
		R += cos(radians(Z)) * 1
		Z = Z - D
	return 2 * R + 1

def main():
	for _ in range(int(stdin.readline())):
		N = int(stdin.readline())
		print(find(N))
main()


import math
t = int(input())
for tc in range(t):
	n = int(input())
	if n == 2:
		print(1)
	else:
		re = math.tan(float(3.141592653 / (n * 2)))
		a = 1 / re
		print(a)


from math import radians, sin
for _ in range(int(input())):
	n = 2 * int(input())
	center = 360 / n
	side = (180 - center) / 2
	length = sin(radians(side))
	print(round(2 * length * length / sin(radians(center)), 7))


from math import pi, sin, sqrt
t = int(input())
for _ in range(t):
	n = int(input())
	r = 0.5 / sin(pi / n / 2)
	al = pi / n * (n // 2) / 2
	x = sin(al) * r * sqrt(2)
	al2 = pi / n * (n // 2 + 1) / 2
	y = sin(al2) * r * sqrt(2)
	print(x + y)


from math import pi, cos, sin
for tc in range(int(input())):
	n = int(input())
	print(cos(pi / (4 * n)) / sin(pi / (2 * n)))


import math
T = int(input())
for tt in range(0, T):
	n = int(input())
	c = round(math.pi / (2 * n), 9)
	a = round(1 / math.sin(c), 9)
	b = round((a * a - 1) ** 0.5, 9)
	print(b)


import math
for _ in range(int(input())):
	n = int(input())
	n = 2 * n
	a = 90 / n * 0.0174532925
	ans = 0.5 / math.sin(a)
	print('{0:.9f}'.format(ans))


import math

def shrey():
	n = int(input())
	print(1 / math.tan(math.pi / (2 * n)))
T = int(input())
for _ in range(1, T + 1):
	shrey()


import math
T = int(input())
while T != 0:
	n = int(input())
	if n == 2:
		print('1')
	else:
		side = math.tan(math.pi / (2 * n))
		print(1 / side)
	T -= 1


import math
for nt in range(int(input())):
	n = int(input())
	m = 2 * n
	a = (m - 2) * 180 / m
	s = 180 - a
	t = s
	ans = 0
	for i in range((n - 2) // 2):
		ans += math.cos(t * math.pi / 180)
		t += s
	print(ans * 2 + 1)


from math import cos, pi, acos
q = int(input())
for _ in range(q):
	n = int(input())
	if n == 2:
		print(1)
		continue
	b = pi / n
	r2 = 1 / (1 - cos(b))
	a = pi / 2 - b
	d = r2 - r2 * cos(a)
	c = (d / 2) ** 0.5
	print(c * 2 + 1)


import math, sys
from collections import defaultdict, Counter, deque
INF = float('inf')
MOD = int(1000000000.0) + 7

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def isPrime(n):
	if n <= 1:
		return False
	i = 2
	while i ** 2 <= n:
		if n % i == 0:
			return False
		i += 1
	return True

def primeFactors(n):
	factors = defaultdict(int)
	i = 2
	while i ** 2 <= n:
		while n % i == 0:
			factors[i] += 1
			n //= i
		i += 1
	if n > 1:
		factors[n] += 1
	return factors

def vars():
	return map(int, input().split())

def array():
	return list(map(int, input().split()))

def main():
	n = int(input())
	n *= 2
	deg = 180 / n
	rad = deg * math.pi / 180
	print(1 / math.tan(rad))
t = 1
t = int(input())
for _ in range(t):
	main()


from math import *
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(1 / tan(radians(90 / n)))
	else:
		print(cos(radians(45 / n)) / sin(radians(90 / n)))


import math

def f(n):
	x = n // 2 + 1
	t = 90 / (x - 1)
	d = math.radians(t)
	r = math.sin(x * d / 2) / math.sin(d / 2)
	return r * math.cos((x - 1) * d / 2) - 1
for _ in range(int(input())):
	print(1 + 2 * f(int(input())))


import math
for t in range(int(input())):
	n = int(input())
	parts = 2 * n
	angle = 360 / (2 * parts)
	y = 0.5
	l = 2 * (y / math.tan(math.radians(angle)))
	print(l)


import math
import collections
from sys import stdin, stdout, setrecursionlimit
import bisect as bs
T = int(stdin.readline())
for _ in range(T):
	n = int(stdin.readline())
	a = 2 * n
	b = math.pi / a
	c = 0.5 / math.tan(b)
	print(round(2 * c, 7))


import sys
import math
import operator as op
from functools import reduce

def read_line():
	return sys.stdin.readline()[:-1]

def read_int():
	return int(sys.stdin.readline())

def read_int_line():
	return [int(v) for v in sys.stdin.readline().split()]

def read_float_line():
	return [float(v) for v in sys.stdin.readline().split()]

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer / denom

def rad(x):
	return math.pi * x / 180
t = read_int()
for i in range(t):
	n = read_int()
	ans = 1 / (2 * math.sin(math.pi / (4 * n)))
	print(ans)


import math
a = int(input())
for i in range(a):
	x = int(input())
	count = math.tan(math.pi * (2 * x - 2) / (4 * x))
	print(count)


from math import tan, pi

def main():
	return '\n'.join(map(str, (squareLengthMin(int(input()) * 2) for x in range(int(input())))))

def squareLengthMin(nSides):
	return 1 / tan(pi / nSides)
print(main())


import math
inp = int(input())
arr = []
for i in range(inp, 0, -1):
	n = int(input())
	n = n * 2
	res = (n - 2) * 180.0
	res = res / (n * 2.0)
	res = math.acos(-1.0) / 180.0 * (res * 1.0)
	print('{:.9f}'.format(round(math.tan(res), 9)))
	arr.append(res)


import math
T = int(input())
for t in range(T):
	n = int(input())
	angle = 360 / (2 * n) / 2 * (math.pi / 180)
	toFlat = 0.5 / math.tan(angle)
	print(2 * toFlat)


from math import *
t = int(input())
while t > 0:
	n = float(input())
	res = 1 / tan(pi / (2 * n))
	print(res)
	t -= 1


import math
for _ in range(int(input())):
	n = int(input())
	n = 2 * n
	pi = math.pi
	ans = math.tan(pi / n)
	print(round(1 / ans, 6))


import math
for _ in range(int(input())):
	print(2 * (1 / (2 * math.tan(2 * math.pi / (4 * float(input()))))))


from math import tan, pi, sin, cos
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print()
	else:
		alpha = pi / n
		x = 0.5 / sin(alpha / 2)
		ans = 2 * (x * cos(3 * alpha / 4) + sin(alpha / 4))
		print(ans)


import math
pi = math.pi
for _ in range(int(input())):
	n = int(input())
	n = n * 2
	ang = 180 * (n - 2) / (2 * n)
	ang = ang * (pi / 180)
	print(math.tan(ang))


import math
t = int(input())
for x in range(t):
	n = int(input())
	ans = round(1 / math.tan(math.pi / (2 * n)), 9)
	print(ans)


from math import pi, sin

def solve(n):
	r = pi / (4 * n)
	m = 1 / sin(r)
	return round(m / 2, 9)
for _ in range(int(input())):
	n = int(input())
	print(solve(n))


import math

def solve(s):
	return 1 / math.tan(math.pi / (2 * s))
t = int(input())
for _ in range(t):
	s = int(input())
	res = solve(s)
	print(res)


import math
import sys
t = int(input())
for i in range(t):
	n = int(input())
	n *= 2
	a = (n - 2) * math.pi / n / 2
	r = 1 / 2 / math.cos(a)
	a2 = (math.pi / 2 - a) / 2
	r2 = r * math.cos(a2)
	print(r2 * 2)


from math import pi, sin
for i in range(int(input())):
	n = int(input())
	a = 0
	ans = 0
	x = pi - pi * (n - 1) / n
	for j in range(n - 1):
		a += x
		ans += sin(a)
	print(ans)


import math
a = int(input())
for i in range(0, a):
	n = int(input())
	print(math.cos(math.pi / (4 * n)) / math.sin(math.pi / (2 * n)))


import math
t = int(input())
l = []
for i in range(t):
	n = int(input())
	l.append(n)
for j in l:
	if j % 2 == 0:
		theeta = math.pi / (2 * j)
		x = 0.5 / math.sin(theeta)
		height = math.sqrt(x ** 2 - 0.5 ** 2)
	else:
		theeta = math.pi / (2 * j)
		height = 0.5 / math.sin(theeta)
	print(2 * height)


import io
import os
from collections import Counter, defaultdict, deque
import math

def solve(N):
	sideAngle = 2.0 * math.pi / (2 * N)
	return 2.0 * 0.5 / math.tan(sideAngle / 2.0)
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
T = int(input())
for t in range(T):
	(N,) = [int(x) for x in input().split()]
	ans = solve(N)
	print(ans)


import math
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	deg = 180 / (2 * n)
	rad = 1 / (2 * math.sin(math.radians(deg)))
	k = (rad ** 2 - 0.25) ** 0.5
	print(min(2 * k, 2 * rad))


import math
t = int(input())
for i in range(t):
	n = int(input())
	n = 2 * n
	val = math.sin((n - 4) / 4 * math.pi / n) / (math.sin(math.pi / n) * 2 ** 1.5)
	print(4 * val + 1)


import math
t = int(input())
for i in range(t):
	n = int(input())
	angulo = math.pi / n
	print(2 * math.cos(angulo / 2) * math.sqrt(0.5 ** 2 / (1 - math.cos(angulo / 2) ** 2)))


import math
for ii in range(int(input())):
	n = int(input())
	y = math.pi / (2 * n)
	print(1 / math.tan(y))


from math import *
for _ in range(int(input())):
	n = int(input())
	val = 0.0
	x = (n - 1) * (pi / n)
	y = pi / 2
	while y > 1 / 10 ** 6:
		val += cos(y)
		y = x + y - pi
	print(val * 2 + 1)


testcases = int(input())
import math
for testcase in range(testcases):
	side = int(input()) * 2
	angle = 360 / (side * 2)
	halfheight = 0.5 / math.tan(math.radians(angle)) * 2
	print(halfheight)


import math
t = int(input())
for j in range(t):
	n = int(input())
	temp = int(n / 2 - 1)
	count = 0
	ang = 360 / (2 * n)
	for i in range(temp):
		ang1 = (i + 1) * ang
		count = count + math.cos(math.radians(ang1))
	ans = float(2 * count + 1.0)
	print(format(ans, '.9f'))


import math
import collections
from sys import stdin, stdout, setrecursionlimit
import bisect as bs
T = int(stdin.readline())
for _ in range(T):
	n = int(stdin.readline())
	t = 2 * n
	x = math.pi / (2 * t)
	h = 0.5 / math.sin(x)
	print(round(h, 7))


import math as m

def fu(a):
	return a / 180 * m.pi
t = int(input())
for _ in range(t):
	n = int(input())
	a = n // 2
	e = a
	if a % 2 != 0:
		a = a + 1
	b = (180 - 360 / (2 * n)) / 2
	s = 0
	for i in range(1, a // 2 + 1):
		s = s + m.sin(fu((2 * i - 1) * b - (i - 1) * 180))
	a = (n - a) // 2
	u = 0
	b = b * 2
	for i in range(1, a + 1):
		u = u + m.sin(fu(i * b - (2 * i - 1) * 90))
	print((2 * s + 2 * u + 1) / m.sqrt(2))


import sys
from math import pi, sin, tan

def solve(n):
	half_angle = 2 * pi / (2 * n) / 2.0
	if n % 2 == 1:
		s = 0.5 / sin(half_angle)
	else:
		s = 0.5 / tan(half_angle)
	return 2 * s
IN = [x.strip() for x in sys.stdin.readlines()]
T = int(IN[0])
cur = 1
for ti in range(T):
	n = int(IN[cur])
	result = solve(n)
	print(result)
	cur += 1


def solution():
	import math

	def anwser(n: int):
		share = math.pi / n
		sum = 0
		for i in range(1, n + 1):
			sum += math.sin(share * i)
		print(sum)
		return 0
	count = int(input())
	for i in range(0, count):
		n = int(input())
		anwser(n)
	return 0
solution()


from math import tan, radians, pi
T = int(input())
for i in range(T):
	n = int(input())
	n *= 2
	alpha = radians(180 * (n - 2) / (2 * n))
	print(1 / tan(pi / 2 - alpha))


from math import tan, pi, radians
x = int(input())
for i in range(x):
	y = int(input())
	pie = pi
	angle = radians(90 / y)
	ans = 1 / tan(angle)
	print('{:.9f}'.format(ans))


import sys
import math
input = iter(sys.stdin.read().splitlines()).__next__
sys.setrecursionlimit(10000)
TC = int(input())
for tc in range(TC):
	N = int(input())
	res = 1 / math.tan(math.pi / (2 * N))
	print('%.10f' % res)


import math
T = int(input())
array = []
for i in range(T, 0, -1):
	n = int(input())
	answer = 0.5 / math.sin(math.asin(1) / (n * 2))
	array.append(answer)
for i in range(len(array)):
	print(array[i])


import math

def tc():
	n = int(input())
	return 1 / math.tan(math.pi / (2 * n))
T = int(input())
for _ in range(T):
	ans = tc()
	print(ans)


def run():
	import sys
	sys.stdin = open('/home/punit/Documents/Cpp Programs/input.txt', 'r')
	sys.stdout = open('/home/punit/Documents/Cpp Programs/output.txt', 'w')
	from math import ceil, sqrt, floor
from math import tan, radians
for _ in range(int(input())):
	x = int(input())
	x = x * 2
	angle = 180 * (x - 2) / x
	rad = radians(angle / 2)
	rad = rad
	print(tan(rad))


import math
t = int(input())
for uuu in range(t):
	n = int(input())
	print(1 / math.tan(math.pi / 2 / n))


import math
t = int(input())
while t > 0:
	n = int(input())
	angle = math.pi / (2 * n)
	ans = 1 / math.tan(angle)
	print('%.9f' % ans)
	t -= 1


from math import *
for u in range(int(input())):
	n = int(input())
	x = tan(pi / (2 * n))
	c = 1 / x
	print(c)


import math
t = int(input())
for tn in range(t):
	n = int(input())
	a = math.pi / (2 * n)
	b = (math.pi - a) / 2
	x = math.sin(b) / math.sin(a)
	print(x)


import math
for i in range(int(input())):
	n = 2 * int(input())
	print(round(1 / math.sin(math.pi / n) * math.cos(math.pi / (2 * n)), 9))


import math
from decimal import Decimal
pi = 3.14159
for _ in range(int(input())):
	n = int(input())
	n = 2 * n
	theta = math.pi * (n - 2) / (n * 2)
	radius = 1 / (2 * math.sin(math.pi / n))
	perp = radius * math.sin(theta)
	print(round(perp * 2, 10))


import math as mt

def polydiagonal(n, a):
	if a < 0 and n < 0:
		return -1
	return a * mt.cos(180 / n * 3.141592653589793 / 180) / mt.sin(180 / n * 3.141592653589793 / 180)
for i in range(int(input())):
	n = int(input())
	print(polydiagonal(2 * n, 1))


from math import sin, pi
for _ in range(int(input())):
	n = int(input()) * 2
	print(1 / (2 * sin(90 / n * pi / 180)))


import math
t = int(input())
for i in range(t):
	n = int(input())
	l = 1
	r = math.pi
	p = r - r * (2 * n - 2) / (2 * n)
	t = p
	for j in range(1, n // 2, 1):
		l += 2 * math.cos(p)
		p += t
	print(l)


import sys
import math
for _ in range(int(input())):
	n = int(sys.stdin.readline())
	x = math.radians((180 - 360 / (2 * n)) / 2)
	l = 1 / math.cos(x)
	deg = 360 / (2 * n)
	theta = math.radians(deg)
	d = 90
	m = 0
	for i in range(2 * n):
		if deg * i < 90:
			d = 90 - deg * i
		else:
			m = i
			break
	(lb, ub) = (math.radians(0), math.radians(d))
	ans = 1000000000.0
	for _ in range(100):
		t = (ub + lb) / 2
		(w, h) = (0, 0)
		for i in range(m):
			w = max(w, math.cos(t + i * theta) * l)
			h = max(h, math.sin(t + i * theta) * l)
		if w >= h:
			lb = t
		else:
			ub = t
		ans = min(ans, max(w, h))
	print(ans)


from math import tan
import math

def polyapothem(n, a):
	if a < 0 and n < 0:
		return -1
	return a / (2 * tan(180 / n * math.pi / 180))
for _ in range(int(input())):
	n = int(input())
	r = polyapothem(2 * n, 1)
	r = 2 * r
	print('%.9f' % r)


t = int(input())
import math
ans = [0] * t
for i in range(t):
	n = int(input())
	theta = 90 / n
	temp = 1 / math.sin(math.radians(theta))
	ans[i] = temp * math.cos(math.radians(theta / 2))
for i in range(t):
	print(format(ans[i], '.9f'))


import math
test = int(input())
while test:
	n = int(input())
	angle = math.pi / (2 * n)
	ans = 1 / math.tan(angle)
	test -= 1
	print(ans)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import math

def fact(x):
	if x == 0:
		return 1
	else:
		return x * fact(x - 1)

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val, lb, ub):
	ans = 0
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = 1
			break
	return ans
from math import *
exec(int(input()) * 'print(1/tan(pi/(2*int(input()))))\n')


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
from typing import List
import math
T = int(input())
ans = []
for ti in range(T):
	N = int(input())
	if N % 2 == 0:
		ans.append(1 / math.tan(math.pi / 2 / N))
	else:
		ans.append(math.cos(math.pi / 4 / N) / math.sin(math.pi / 2 / N))
print('\n'.join(['{:.9}'.format(v) for v in ans]))


import math
t = int(input())
for _ in range(t):
	n = int(input())
	n *= 2
	if n == 4:
		print('1.000000000')
		continue
	c = 360 / float(n)
	d = c
	n = n // 4
	n -= 1
	s = 0
	for i in range(n):
		s += math.cos(math.radians(c)) * 2
		c += d
	print(s + 1)


import math
t = int(input())
for i in range(t):
	n = int(input()) * 2
	r = 1 / (2 * math.sin(math.pi / n))
	ans = ((2 * r) ** 2 - 1) ** 0.5
	print(ans)


import math

def fun(n):
	k = math.cos(math.radians(360 / n))
	return math.sqrt(2 / (1 - k) - 1)
for _ in range(int(input())):
	print(fun(2 * int(input())))


from math import sin, radians, sqrt

def solve():
	n = int(input())
	a = 360 / (2 * n)
	a /= 2
	d = 1 / sin(radians(a))
	r = d / 2
	res = sqrt(r ** 2 - 0.25) * 2
	return res

def main():
	t = int(input())
	while t:
		print(solve())
		t -= 1
main()


import sys, math
readline = sys.stdin.readline

def rou(x):
	_x = int(x)
	if x - _x < 0.5:
		return _x
	else:
		return _x + 1

def solve():
	N = int(readline())
	N2 = N * 2
	a = math.pi * 2 / N2
	k = rou(N2 / 8)
	r = 1 / 2 / math.sin(math.pi / N2)
	p = r * math.cos(k * a)
	q = r * math.sin(k * a)
	ans = 2 ** 0.5 * (p + q)
	print(ans)
T = int(readline())
for i in range(T):
	solve()


import sys

def eprint(*args):
	print(*args, file=sys.stderr)
zz = 1
from math import *
import copy
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')

def li():
	return [int(x) for x in input().split()]

def fi():
	return int(input())

def si():
	return list(input().rstrip())

def mi():
	return map(int, input().split())
t = fi()

def yes(f):
	for i in range(2 * n):
		if -f / 2 <= d[i][0] <= f / 2 and -f / 2 <= d[i][1] <= f / 2:
			continue
		else:
			return False
	return True
while t > 0:
	t -= 1
	n = fi()
	r = 1 / (2 * tan(pi / 180 * (360 / (4 * n))))
	th = pi / n
	d = []
	for i in range(2 * n + 1):
		d.append([r * cos(i * th), r * sin(i * th)])
	ans = 0
	l = 0
	r = 10 ** 9
	while r - l >= 10 ** (-7):
		mid = l + (r - l) / 2
		if yes(mid):
			ans = mid
			r = mid
		else:
			l = mid
	print(ans)


import math
kl = int(input())
for l in range(kl):
	n = int(input())
	print(1 / math.tan(math.pi / (2 * n)))


from math import *
t = int(input())
for cid in range(t):
	n = int(input())
	a = 0.5 * pi / n
	print(2 * (0.5 / tan(a)))


import sys

def eprint(*args):
	print(*args, file=sys.stderr)
zz = 1
from math import *
import copy
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')

def li():
	return [int(x) for x in input().split()]

def fi():
	return int(input())

def si():
	return list(input().rstrip())

def mi():
	return map(int, input().split())
t = fi()
while t > 0:
	t -= 1
	n = fi()
	s = 1 / (2 * tan(pi / 180 * (360 / (4 * n))))
	print(2 * s)


import math
t = 1
t = int(input())
for tt in range(t):
	n = int(input())
	print(math.tan(math.pi * (2 * n - 2) / (4 * n)))


import copy
import fractions
import heapq
import math
import random
import sys
T = int(input())
for t in range(T):
	n = int(input())
	print(1 / math.tan(math.pi / (2 * n)))


from math import cos, pi, sin, sqrt
for _ in range(int(input())):
	n = int(input())
	k0 = (n + 2) // 4
	alpha = k0 * pi / n
	print((sin(alpha) + cos(alpha)) / (sqrt(2) * sin(pi / (2 * n))))


from math import sin, cos, pi, sqrt
for _ in range(int(input())):
	n = int(input())
	r = 0.5 / sin(pi / (2 * n))
	a = pi / n * (n // 2)
	b = pi / n * (n // 2 + 1)
	x = r * sin(a) / sin((pi - a) / 2)
	y = r * sin(b) / sin((pi - b) / 2)
	print((x + y) / sqrt(2))


import sys
import heapq
from math import *
import bisect

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, input().split())

def rlinput():
	return list(map(int, input().split()))

def srlinput(fl=False):
	return sorted(list(map(int, input().split())), reverse=fl)

def main():
	n = iinput()
	t = cos(pi * (n - 1) / (2 * n))
	print(((1 - t) ** 0.5 + (1 + t) ** 0.5) / (2 * sin(pi / (2 * n))))
for sdfghjkl in range(iinput()):
	main()


from math import sqrt
import math
t = int(input())
for i in range(t):
	a = int(input())
	e = 1 / math.tan(math.pi / (2 * a))
	print(e)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def YES(c):
	return IF(c, 'YES', 'NO')

def Yes(c):
	return IF(c, 'Yes', 'No')

def main():
	t = I()
	rr = []
	for _ in range(t):
		n = I()
		k = 180 - (n * 2 - 2) * 180 / n / 2
		r = 0
		for i in range(1, n // 2):
			r += math.sin(math.radians(k * i))
		rr.append(r * 2 + 1)
	return JA(rr, '\n')
print(main())


import math
numOfRecords = input()
for i in range(0, int(numOfRecords)):
	noOfSides = input()
	result = 1 / math.tan(math.pi / (2 * int(noOfSides)))
	print(result)


from sys import stdin, stdout
from math import tan, pi
for _ in range(int(input())):
	n = int(input())
	angle = 180.0 / n / 2.0
	r = 0.5 / tan(angle * pi / 180.0)
	print('{:.9f}'.format(r * 2.0))


t = int(input())
import math
for _ in range(t):
	n = int(input())
	if n == 2:
		print(1)
	else:
		m = (n - 2) // 2
		y = math.sin(m * math.pi / (2 * n)) / math.sin(math.pi / (2 * n))
		x = y * math.sqrt(2) / 2
		ans = 1 + x * 2
		print(ans)


from sys import stdin, stdout
from math import *
from heapq import *
from collections import *

def main():
	ntest = int(stdin.readline())
	for testcase in range(ntest):
		n = int(stdin.readline())
		ln = 0
		radius = 1 / (2 * sin(pi / (2 * n)))
		rot = pi / (2 * n)
		if n % 2 == 1:
			rot = 0
		s = cos(rot)
		for i in range(2, n + 1):
			ang = i * pi / n + rot
			cs = cos(ang)
			ln += abs(s - cs) * radius
			s = cs
		stdout.write('%.09f\n' % ln)
	return 0
main()


import sys
import math
from collections import defaultdict

def solve(test):
	n = int(input())
	ans = 1.0 / math.tan(math.pi / (2.0 * n))
	print(ans)
test_cases = int(input())
for t in range(1, test_cases + 1):
	solve(t)


from math import tan, pi, sin, cos

def test(n, an):
	r = 0.5 / tan(pi / n)
	b = r * tan(an)
	c = 0.5 - b
	compl = pi / 2 - an
	return r / cos(an) + c * cos(compl)
for _ in range(int(input())):
	n = int(input())
	n *= 2
	print(2 * test(n, pi / 2 / n))


import math
T = int(input())
while T:
	n = int(input())
	if n % 2 == 0:
		rad = 0.0174533
		internal_angle = (n - 1) * 180 * 1.0 / (n * 1.0)
		prevAngle = 0
		ans = 1.0
		while True:
			cur_angle = 180 - internal_angle + prevAngle
			prevAngle = cur_angle
			co = math.cos(cur_angle * rad)
			if co <= 0:
				break
			ans = ans + 2.0 * co
		print(ans)
	T -= 1


import math
T = int(input())
for _ in range(T):
	n = int(input())
	th = math.pi / (2 * n)
	res = 1.0 / math.tan(th)
	print(res)


import math as m
t = int(input())
pi = m.pi
while t > 0:
	t -= 1
	n = int(input())
	a = pi / n
	b = (pi - a) / 2
	d = m.sin(b) / m.sin(a)
	d *= 2
	d = d * d
	d -= 1
	d = m.sqrt(d)
	d = round(d, 9)
	print('{0:.9f}'.format(d))


import math
for __ in range(int(input())):
	n = int(input())
	n = 2 * n
	a = 1 / math.tan(math.pi / n)
	print('%0.9f' % a)


import math
test = int(input())
while test:
	n = int(input())
	angle = math.pi / (2 * n)
	ans = 1 / math.sin(angle)
	test -= 1
	p = math.cos(angle / 2)
	print(ans * p)


import math
for _ in range(int(input())):
	x = int(input())
	print(1 / (2 * math.sin(math.pi / (4 * x))))


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools, itertools, operator
from collections import deque, defaultdict, OrderedDict
import collections

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	for _ in range(ri()):
		n = 2 * ri()
		z = math.radians(180 / n)
		r = 1 / (2 * math.sin(z)) ** 2 - 0.25
		print(2 * math.sqrt(r))
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

	def flush(self):
		os.write(self._fd, self.buffer.getvalue())
		(self.buffer.truncate(0), self.buffer.seek(0))

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


from math import cos, pi
for _ in range(int(input())):
	n = int(input())
	n *= 2
	ans = 0.0
	theta = angle = 180 - 180 * (n - 2) / n
	while theta < 90:
		ans += cos(theta * pi / 180)
		theta += angle
	ans = ans * 2 + 1
	print(ans)


import math
for _ in range(int(input())):
	n = int(input())
	p = math.pi
	r = 0.5 / math.sin(p / (2 * n))
	an1 = n // 2 * (p / n)
	an2 = p - an1
	b = r * math.sin(an1 / 2) * 2 ** 0.5
	c = r * math.sin(an2 / 2) * 2 ** 0.5
	print(b + c)


import math
t = int(input())
for _ in range(t):
	n = int(input())
	angle = math.pi / (2 * n)
	e2e = 1 / math.tan(angle)
	c2c = 1 / math.sin(angle)
	if n % 2 == 1:
		print('%.10f' % c2c)
	else:
		print('%.10f' % e2e)


import math
radius = lambda n: 1 / (2 * math.sin(math.pi / n))
side_3_sq = lambda a, b, C: a ** 2 + b ** 2 - 2 * a * b * math.cos(C)
t = int(input())
for i in range(t):
	n_side = 2 * int(input())
	r = radius(n_side)
	C = 2 * math.pi / n_side * ((n_side - 4) // 4)
	x = math.sqrt(side_3_sq(r, r, C) / 2)
	print(1 + 2 * x)


import math
t = int(input())
ans = []
for s in range(t):
	n = int(input())
	p = math.tan(float(math.pi / (2 * n)))
	a = float(1 / p)
	ans.append(a)
for it in ans:
	print('%.9f' % it)


import sys
from math import pi, sin, tan, cos, atan

def find_D(alpha):
	return atan((1.0 - cos(alpha)) / sin(alpha))

def solve(n):
	half_angle = 2 * pi / (2 * n) / 2.0
	if n % 2 == 1:
		to_corner = 0.5 / sin(half_angle)
		d = find_D(half_angle)
		s = to_corner * cos(d)
	else:
		s = 0.5 / tan(half_angle)
	return 2 * s
IN = [x.strip() for x in sys.stdin.readlines()]
T = int(IN[0])
cur = 1
for ti in range(T):
	n = int(IN[cur])
	result = solve(n)
	print(result)
	cur += 1


from math import *
for _ in range(int(input())):
	n = int(input())
	x = pi / n
	ans = 1
	c = n - 1
	while c > 0:
		ans += 2 * cos(x)
		x += pi / n
		c -= 2
	print(ans)


from math import *
for u in range(int(input())):
	n = int(input())
	X = pi / (2 * n)
	print(cos(X / 2) / sin(X))


import math
test_case = int(input())
for q in range(test_case):
	n = int(input())
	x = 1 / math.tan(math.radians(90 / n))
	print(x)


from collections import Counter, defaultdict, deque
from math import *
import sys
input = sys.stdin.readline

def solve():
	n = 2 * int(input())
	d = 1 / tan(pi / n)
	print(d)
tt = int(input())
for test in range(tt):
	solve()


import io
import os
from collections import Counter, defaultdict, deque
import math

def solve(N):
	sideAngle = 2.0 * math.pi / (2 * N)
	theta = sideAngle / 2.0
	x = 0.5
	y = x / math.tan(theta)
	z = (x ** 2 + y ** 2) ** 0.5

	def f(rot):
		return max(z * math.cos(theta - rot), z * math.cos(rot))
	EPS = 1e-07
	lo = 0
	hi = theta
	while hi - lo > EPS:
		mid1 = lo + (hi - lo) / 3.0
		mid2 = lo + 2.0 * (hi - lo) / 3.0
		values = [f(x) for x in [lo, mid1, mid2, hi]]
		deltas = [values[1] - values[0], values[2] - values[1], values[3] - values[2]]
		if deltas[0] > 0:
			hi = mid1
		elif deltas[0] <= 0 and deltas[1] >= 0:
			hi = mid2
		elif deltas[1] <= 0 and deltas[2] >= 0:
			lo = mid1
		else:
			assert deltas[2] <= 0
			lo = mid2
	return f(lo) * 2
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
T = int(input())
for t in range(T):
	(N,) = [int(x) for x in input().split()]
	ans = solve(N)
	print(ans)


from math import pi, cos, sqrt

def sol(n):
	cth = cos(pi / n)
	x = 1 / sqrt(2 * (1 - cth))
	if n % 2:
		return x * 2
	else:
		return sqrt(x * x - 0.25) * 2
N = int(input())
while N > 0:
	ans = sol(int(input()))
	print(ans)
	N -= 1


import math
t = int(input())
while t:
	t -= 1
	n = int(input())
	ang = math.pi / (2 * n)
	ans = 1 / math.sin(ang)
	print(ans * math.cos(ang / 2))


from sys import stdin
import math
input = stdin.buffer.readline
for _ in [0] * int(input()):
	print(1 / math.tan(math.pi / (2 * int(input()))))


import math
T = int(input())
for _ in range(T):
	n = int(input())
	th = math.pi / (2 * n)
	l = 1.0 / math.sin(th)
	th1 = n // 2 * (2 * th)
	th = math.atan((1 - math.sin(th1)) / math.cos(th1))
	res = l * math.cos(th)
	print(res)


import math
t = int(input())
for you in range(t):
	n = int(input())
	R = 1 / math.sin(math.pi / (2 * n))
	print(math.sqrt(R * R - 1))


import math
from sys import stdin
for _ in range(int(stdin.readline())):
	n = int(stdin.readline()) * 2
	b = 0.5 / math.tan(math.pi / n)
	print(b * 2)


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
import math
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def main():
	b = math.pi
	for tin in range(int(input())):
		n = int(input())
		if n == 2:
			print(1.0)
		else:
			n = 2 * n
			ang = (n - 2) * b / n - b / 2
			y = (n - 2) * b / n
			a = [ang]
			x = ((n - 2) / 2 - 1) / 2
			ans = 0
			for _ in range(int(x) - 1):
				ang = b - ang
				ang = y - ang
				a.append(ang)
			for _ in range(len(a)):
				ans += math.cos(a[_])
			ans = ans * 2 + 1
			print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import math
t = int(input())
for _ in range(t):
	n = int(input())
	r = (1 / 2 / (1 - math.cos(math.radians(180 / n)))) ** 0.5
	if n % 2 == 1:
		print('%.7f' % (2 * r))
	else:
		s = r * r * math.sin(math.radians(180 / n))
		print('%.7f' % (2 * s))


import math
for _ in range(int(input())):
	a = int(input())
	x = math.pi / (2 * a)
	y = x / 2
	v = math.cos(y)
	b = math.sin(x)
	print('{0:6f}'.format(v / b))


import math as m
for _ in range(int(input())):
	n = int(input())
	if n == 2:
		k = 1
		print('%.9f' % k)
	else:
		t = 360 / (2 * n)
		t = t / 2
		t = t * m.pi / 180
		x = m.tan(t)
		print('%.9f' % (1 / x))


import math
for _ in range(int(input())):
	n = int(input())
	side = 2 * n
	ans = 2 * (0.5 * (1 / math.tan(math.pi / side)))
	print(round(ans, 9))


from math import tan
for _ in range(int(input())):
	n = int(input())
	pi = 3.141592653589793
	n += n
	res = n / 4
	res /= tan(pi / n)
	res /= n / 4
	print('%.9f' % res)


import math
T = int(input())
for t in range(T):
	n = int(input()) * 2
	k1 = math.ceil(n / 4) - 2
	k2 = math.ceil(n / 4) - 1
	exter = 2 * math.pi / n
	inter = math.pi * (n - 2) / n
	alpha = (k1 * inter - math.pi / 2) / 2
	beta = (k2 * inter - math.pi / 2) / 2
	result = abs(math.cos(alpha)) + abs(sum([math.cos(alpha + exter * k) for k in range(1, k1 + 1)])) + abs(math.cos(beta)) + abs(sum([math.cos(beta + exter * k) for k in range(1, k2 + 1)]))
	print(result)


import math
for _ in range(int(input())):
	x = int(input())
	x = x * 2
	y = math.tan(3.1415926535 / x)
	print(1 / y)


import math
for i in range(int(input())):
	sides = 2 * int(input())
	radius = 1 / (2 * math.sin(math.pi / sides))
	x = math.cos(-math.pi / (2 * sides)) / math.sin(math.pi / sides)
	print(x)


import math
TT = int(input())
for _ in range(TT):
	n = int(input())
	cc = 1 / math.tan(math.pi / (2 * n))
	r = cc / 2
	d = 2 * r
	ans = d
	print(ans)


from math import *
for _ in range(int(input())):
	n = 2 * int(input())
	a = pi - pi * (n - 2) / n
	ans = 0
	for i in range(1, n // 4):
		ans += cos(i * a)
	print(2 * ans + 1)


from cmath import *
for s in [*open(0)][1:]:
	print(1 / tan(pi / 2 / int(s)).real)


import math
for _ in range(int(input())):
	n = int(input())
	s = 2 * n
	side = ((1 / math.sin(math.pi / s)) ** 2 - 1) ** 0.5
	print(side)


import math
for _ in range(int(input())):
	n = int(input())
	print(1 / math.tan(3.14159265 / (2 * n)))


import math

def x(i):
	su = 0
	s = math.pi / i
	for x in range(1, i + 1):
		su += math.sin(s * x)
	print(su)
n = int(input())
while n:
	n -= 1
	x(int(input()))


from sys import stdin
import math
inp = lambda : stdin.readline().strip()
t = int(inp())
for _ in range(t):
	n = int(inp()) * 2
	o = 360 / n * (math.pi / 180)
	ans = math.sqrt((1 / (2 * math.tan(o / 2)) + 1 / (2 * math.sin(o / 2))) * (2 * (1 / (2 * math.sin(o / 2)))))
	print(ans)


import os
import sys
if os.path.exists('/mnt/c/Users/Square/square/codeforces'):
	f = iter(open('C.txt').readlines())

	def input():
		return next(f).strip()
else:
	input = lambda : sys.stdin.readline().strip()
fprint = lambda *args: print(*args, flush=True)
import math
t = int(input())
for _ in range(t):
	n = int(input())
	print(1.0 / math.tan(math.pi / 2 / n))


import math
for _ in range(int(input())):
	n = int(input())
	s = 1
	ans = 1
	angle = (n - 1) * 180 / n
	angle *= math.pi / 180
	for i in range(n // 2):
		s += abs(2 * math.cos(angle * (i + 1)))
		ans = max(ans, s)
	print('%6f' % ans)


t = int(input())
import math
for _ in range(t):
	n = int(input())
	ans = math.cos(math.pi / (4 * n)) / math.sin(math.pi / (2 * n))
	print(ans)


from collections import Counter
import math
import sys

def input():
	return sys.stdin.readline().strip()

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def mod():
	return 10 ** 9 + 7
for _ in range(INT()):
	x = INT()
	n = 2 * x
	rad = math.tan(3.141592653589 / n)
	print(1 / rad)


from cmath import *
for i in range(int(input())):
	a = int(input())
	print(1 / tan(pi / 2 / a).real)


import math
t = int(input())
while t:
	t -= 1
	n = int(input())
	angleinDegrees = 90 - 90 / n
	angleInRad = math.radians(angleinDegrees)
	print('%.8f' % math.tan(angleInRad))


import math

def rn():
	a = int(input())
	return a

def rl():
	a = list(map(int, input().split()))
	return a
for _ in range(int(input())):
	n = rn()
	n = 2 * n
	ang1 = math.pi / n
	hyp = 1 / (2 * math.sin(ang1))
	base = 1 / 2
	perp = math.sqrt(hyp ** 2 - base ** 2)
	print(2 * perp)


from sys import setrecursionlimit
from collections import deque
import math
import heapq
import functools
for _ in range(int(input())):
	s = 2 * int(input())
	ans = 1 / (2 * math.tan(math.pi * 2 / (2 * s)))
	print(ans * 2)


import sys
import math
t = int(sys.stdin.readline())
for i in range(t):
	n = int(sys.stdin.readline())
	pi = math.pi
	theta = 0
	ans = 0
	while 2 * theta < pi:
		ans += math.cos(theta)
		theta += pi / n
	k = 2 * ans - 1
	theta = 0
	while 4 * theta < pi:
		theta += pi / n
	if abs(theta - pi / n - pi / 4) < abs(theta - pi / 4):
		theta -= pi / n
	ans = k * math.sin(theta) / math.sin(pi / 4) + k * math.sin(pi / 2 - theta) / math.sin(pi / 4)
	print(ans / 2)


import math
T = int(input())
for t in range(T):
	n = int(input())
	theta = math.pi / n
	ans = 1 / math.tan(theta / 2)
	print(ans)


import math
t = int(input())
for i in range(t):
	n = int(input())
	r = math.pi
	a = r * (2 * n - 2) / (2 * n)
	k = (r * (n // 2) - r / 2 - (n // 2 - 1) * (2 * r - a)) / 2
	ans = math.sin(k)
	for j in range(n - 1):
		k = k + r - a
		ans += math.sin(k)
	print(ans)


from math import tan, pi

def getApothem(n):
	return 1 / (2 * tan(pi / n))
for _ in range(int(input())):
	n = int(input())
	print('{0:.6f}'.format(2 * getApothem(2 * n)))


import math
el = int(input())
for i in range(el):
	num = int(input())
	num = 2 * num
	r = 1 / 2 * 1 / math.tan(math.radians(180 / num))
	print(r * 2)


from math import *
exec(int(input()) * 'print(1/tan(pi/(2*int(input()))))\n')


import math

def main():
	n = int(input())
	a = math.pi / (2 * n)
	x = 1 / math.sin(a) / 2
	res = 2 * math.cos(a) * x
	print(res)
for _ in range(int(input())):
	main()


import math
t = int(input())
for i in range(t):
	n = int(input())
	n //= 2
	print(1 / math.tan(math.radians(45 / n)))


from math import pi, cos
t = int(input())
for _ in range(0, t):
	n = int(input())
	theta = pi / 4
	delta = pi / n
	(maxi, mini, x) = (0, 0, 0)
	for i in range(0, 2 * n):
		x += cos(theta)
		theta -= delta
		maxi = max(maxi, x)
		mini = min(mini, x)
	print(maxi - mini)


import math
t = int(input())
for you in range(t):
	n = int(input())
	cur1 = (2 * n - 2) // 4
	if cur1 % 2 == 1:
		cur1 += 1
	cur2 = n - cur1
	pio = math.pi
	ans = 1 / math.sin(pio / (2 * n))
	mao = ans * (math.sin(cur1 * pio / (2 * n)) + math.sin(cur2 * pio / (2 * n)))
	print(mao / math.sqrt(2))


import math
for _ in range(int(input())):
	n = int(input())
	x = 1 / math.tan(math.pi / n / 2)
	print('%.17f' % x)


import math
t = int(input())
for i in range(0, t):
	n = 2 * int(input())
	q = (n - 2) / n * math.pi
	print(math.tan(q / 2))


import math

def main():
	n = int(input())
	if n <= 2:
		print(1)
	else:
		res = 0
		angel = 0
		turn = 180 * (n * 2 - 2) / (n * 2)
		for i in range(0, n):
			angel += turn
			res += abs(math.sin(math.radians(angel)))
		print(res)
t = int(input())
for i in range(t):
	main()


import math

def rad(angle):
	return angle / 180 * math.pi

def dist(a, b, c, d):
	return math.sqrt((a - c) * (a - c) + (b - d) * (b - d))
tt = int(input())
while tt > 0:
	tt -= 1
	n = int(input())
	angle = rad(360 / (2 * n))
	(l1, l2) = (n // 2, n - n // 2)
	(px, py) = (0, 0)
	(vx, vy) = (1, 0)
	ans = 0
	cur = 0
	for i in range(1, n + 1):
		px += vx
		py += vy
		if i == l1 or i == l2:
			ans += dist(0, 0, px, py)
		cur += angle
		vx = math.cos(cur)
		vy = math.sin(cur)
	print(ans / math.sqrt(2))


import math
t = int(input())
for i in range(t):
	n = int(input())
	r = 1 / (2 * math.sin(math.pi / (4 * n)))
	print(r)


import math
t = int(input())
while t:
	t -= 1
	n = int(input())
	if n == 2:
		print(1)
	else:
		n = 2 * n
		dia = 1 / math.sin(math.pi / n)
		beta = 2 * (n / 4 - 1) * math.pi / n
		y = dia * math.sin(beta / 2)
		y = y / math.sqrt(2)
		print(1 + 2 * y)


import math
T = int(input())
for i in range(T):
	n = int(input())
	a = math.radians(90 / n)
	print(1 / math.tan(a))


import math
for _ in range(int(input())):
	n = int(input())
	if n == 2:
		print(1.0)
	else:
		side = (n + 1) // 2
		size = 1
		angle = math.pi / n
		for i in range(1, side):
			size += 2 * 1 * round(math.cos(angle * i), 8)
		print(size)


from math import *
pi = acos(-1)
t = int(input())
while t >= 1:
	n = int(input())
	print(1 / tan(pi / (2 * n)))
	t = t - 1


from math import sqrt
from math import tan
from math import pi
t = int(input())
for tc in range(t):
	n = int(input())
	print(1 / tan(pi / (2 * n)))


from math import *
for t in range(int(input())):
	n = int(input())
	print(tan((2 * n - 2) * 45 / n * pi / 180))


import sys, math
tc = int(sys.stdin.readline())
for _ in range(tc):
	n = int(sys.stdin.readline())
	theta = 360 / (2 * n)
	p2p = 1 / math.tan(math.radians(theta / 2))
	s2s = 1 / math.sin(math.radians(theta / 2))
	print(min(p2p, s2s))


from math import cos, pi
s = [0] * 201
for k in range(2, 201, 2):
	k //= 2
	d = pi / k / 2
	s[k] = sum((cos(i * d) for i in range(k))) * 2 - 1
for _ in range(int(input())):
	k = int(input()) // 2
	print(s[k])


import sys
import math
readline = sys.stdin.readline
read = sys.stdin.read
ns = lambda : readline().rstrip()
ni = lambda : int(readline().rstrip())
nm = lambda : map(int, readline().split())
nl = lambda : list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def solve():
	n = ni()
	print(math.cos(math.pi / (4 * n)) / math.sin(math.pi / (2 * n)))
	return
T = ni()
for _ in range(T):
	solve()


import sys
import math
pprint = lambda s: print(' '.join(map(str, s)))
input = lambda : sys.stdin.readline().strip()
ipnut = input
for i in range(int(input())):
	n = int(input())
	print(1 / math.tan(math.pi / (2 * n)))


import math
for _ in range(int(input())):
	n = int(input())
	s = 2 * n
	k = math.pi / s
	ans = math.cos(k) / math.sin(k)
	print(ans)


import math
t = int(input())
for _ in range(t):
	a = int(input())
	n = 2 * a
	sq_side = 2 * 1 / (2 * math.tan(math.radians(180 / n)))
	print('%.9f' % sq_side)


from math import *

def cot(n):
	return 1 / tan(radians(n))
t = int(input())
for y in range(t):
	n = int(input())
	print(cot(180 / (2 * n)))


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop
import math
from collections import *
from functools import reduce, cmp_to_key, lru_cache
import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
M = mod = 10 ** 9 + 7

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip().split()]

def st():
	return str(input().rstrip())[2:-1]

def val():
	return int(input().rstrip())

def li2():
	return [str(i)[2:-1] for i in input().rstrip().split()]

def li3():
	return [int(str(i)[2:-1]) for i in input().rstrip()]
from math import radians, tan
for _ in range(val()):
	n = 2 * val()
	theta = 360 / n
	print(1 / tan(radians(theta / 2)))


import math
t = int(input())
while t:
	t += -1
	n = int(input()) * 2
	theta = n // 4 * math.pi / n
	R = 1 / (2 * math.sin(math.pi / n))
	a = 2 ** 0.5
	print(R * a * (math.sin(theta) + math.cos(theta)))


import math
for i in range(int(input())):
	n = int(input())
	tri = 90.0 / (n / 2)
	trid = ans = 0.0
	for i in range(1, n // 2):
		trid += tri
		ans += math.cos(trid * (math.pi / 180.0))
	print('%.9f' % ((ans + 0.5) * 2))


import math
tc = int(input())
while tc > 0:
	n = 2 * int(input())
	print(1 / math.tan(math.pi / n))
	tc -= 1


from math import cos, sin, pi

def main():
	t = int(input())
	for tc in range(t):
		n = int(input())
		ans = cos(pi / 4 / n) / sin(pi / 2 / n)
		print(ans)
main()


from math import sin
from math import pi

def f(n):
	d = 1 / sin(pi / 2 / n)
	ro = (n - 1) / (2 * n) * pi
	ang = (3 / 2 * pi - ro) / 2
	return d * sin(ang)
t = int(input())
for i in range(t):
	print(f(int(input())))


import math as m
t = int(input())
for _ in range(t):
	n = int(input())
	if n == 2:
		print(1)
	else:
		l = 1 / m.tan(m.pi / (2 * n))
		print(l)


from sys import stdin
from math import tan, radians
input = stdin.readline
R = lambda : map(int, input().split())
for _ in range(int(input())):
	n = int(input()) * 2
	print(2 * (1 / (2 * tan(radians(180 / n)))))


import math
for _ in range(int(input())):
	n = int(input())
	angle = math.pi / n / 4
	ans = 1 / (2 * math.sin(angle))
	print(ans)


from math import tan, radians
for _ in range(int(input())):
	n = int(input())
	print(1 / tan(radians(360 / (4 * n))))


from math import pi
from math import tan
t = int(input())
for _ in range(t):
	n = int(input())
	n *= 2
	ang_deg = 180 * (n - 2) / n
	ang_rad = ang_deg * pi / 180
	print(tan(ang_rad / 2))


import math
t = int(input())
for i in range(t):
	n = int(input()) * 2
	a = 90 * (n - 2) / n
	ta = math.tan(math.radians(a))
	print(ta)


import math
PI = math.acos(-1)
epsilon = PI / 180

def solve():
	n = int(input())
	print('%.9f' % (1 / math.tan(90 / n * epsilon)))
t = int(input())
for i in range(t):
	solve()


import sys
input = sys.stdin.readline
from collections import *
from math import *
t = int(input())
for _ in range(t):
	n = int(input())
	ans = 1
	theta = 180 - 180 / n - 90
	for i in range((n - 1) // 2):
		ans += 2 * cos(radians(theta))
		theta = 180 - 180 / n - 90 - (90 - theta)
	print(ans)


import math
t = int(input())
while t:
	t += -1
	n = int(input()) * 2
	print(0.5 / math.sin(0.5 * (math.pi / n)))


import math
import sys
import collections

def set_debug(debug_mode=False):
	if debug_mode:
		fin = open('input.txt', 'r')
		sys.stdin = fin
t = int(input())
for ti in range(1, t + 1):
	n = int(input())
	n = 2 * n
	res = 1
	inner = math.pi - (n - 2) * math.pi / n
	cur = 0.5
	for i in range((n - 2) // 4):
		cur += 1 * math.cos((i + 1) * inner)
	the = math.pi / 2 - (n - 2) * math.pi / n / 2
	res = 2 * cur * math.cos(the / 2)
	print(res)


from math import sin, pi, radians

def solve():
	n = int(input()) * 2
	a = 180 * (n - 2) / n
	bc = (180 - a) / 2
	d = 0.5 / sin(radians(bc))
	return round(2 * (d ** 2 - 0.25) ** 0.5, 8)
for _ in range(int(input())):
	print(solve())


import math
n = int(input())
for i in range(n):
	x = int(input())
	print(2 * x / (4 * math.tan(math.pi / (2 * x))) / (x / 2))


from math import *
from collections import *
from itertools import *
from bisect import *
from heapq import *
from operator import *
from sys import *
setrecursionlimit(1000000)
d = defaultdict(lambda : 0, {})

def io():
	return map(int, input().split())

def op():
	return list(map(int, input().split()))

def o():
	return int(input())

def r(x):
	return range(len(x))

def mk(a, b):
	if a > b:
		return (b, a)
	else:
		return (a, b)

def kl(con, x=0):
	if x == 0:
		print('Yes') if con else print('No')
	elif x == 1:
		print('yes') if con else print('no')
	elif x == 2:
		print('YES') if con else print('NO')
MOD = 1000000007
MAX = float('inf')
MIN = -float('inf')
p = input
for _ in range(o()):
	n = o()
	n *= 2
	y = 1 / (2 * sin(pi / n))
	print(sqrt(y ** 2 - (1 / 2) ** 2) * 2)


import math
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	n2 = 2 * n
	val = 1.0
	theta = math.pi - (n2 - 2) * math.pi / n2
	for i in range(1, (n - 2) // 2 + 1):
		val += math.cos(theta * i) * 2.0
	print(val)


import math
t = int(input())
for kase in range(t):
	n = int(input())
	assert n % 2 == 0
	ans = 0
	step_angle = math.pi / n
	for i in range(n):
		ang = math.pi / 2 - step_angle * (i + 1)
		ans += math.cos(ang)
	print(ans)


import math
pi = math.pi

def polygon(n, pi):
	n = n * 2
	if n % 4 == 0:
		return 1 / math.tan(pi / n)
	else:
		return 1 / math.sin(pi / n)
t = int(input())
a = []
for i in range(t):
	a.append(int(input()))
for x in a:
	print(polygon(x, pi))


import math
test = int(input())
for tes in range(test):
	n = int(input())
	angle = 90 / n
	r = 1 / math.tan(angle * math.pi / 180)
	print(r)


import math
from math import tan
for _ in range(int(input())):
	n = float(input())
	s = 2 * n
	r = 0.5 / math.sin(math.pi / s)
	print(2 * r * math.cos(math.pi / s))


import math
from sys import stdin, stdout

def II():
	return int(stdin.readline())
t = II()
for _ in range(t):
	n = II()
	theta = math.pi / (2 * n)
	ans = 1 / math.tan(theta)
	stdout.write(str(ans) + '\n')


import math

def ans(b):
	p = 2 * math.pi
	f = p / (b + b)
	g = 1 / math.tan(f / 2)
	print('%.9f' % g)
t = int(input())
while t > 0:
	a = int(input())
	ans(a)
	t -= 1


import math
t = int(input())
for _ in range(t):
	n = int(input())
	x = math.tan(math.radians(360 / (4 * n)))
	x = 0.5 / x
	x -= 0.5
	x *= 2
	print(1 + x)


import math as m
for i in range(int(input())):
	a = int(input())
	print(1 / m.tan(m.pi / (2 * a)))


import math
for _ in range(int(input())):
	n = int(input())
	if n == 2:
		print('1.000000')
	else:
		k = 2 * n
		t = (k - 2) / k * math.pi
		if n % 4 == 0:
			print('{0:.8f}'.format(math.tan(t / 2)))
		else:
			print('{0:.8f}'.format(math.tan(t / 2)))


import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	polyang = (n + n - 2) * 180 / (n + n)
	if n % 2 == 0:
		ans = 1
		temp = 90
		for i in range((n - 1) // 2):
			ans += 2 * math.cos(math.radians(polyang - 90 - (90 - temp)))
			temp = polyang - 90 - (90 - temp)
		print(ans)
	else:
		ans = 1 / math.sin(math.radians(180 / (n + n)))
		print(ans)


import math

def solution():
	n = int(input())
	for i in range(n):
		t = int(input())
		apothem = 1 / (2 * math.tan(math.pi / (2 * t)))
		print(2 * apothem)
solution()


import math
t = int(input())
for _ in range(t):
	n = int(input())
	angle = (2 * n - 2) * math.pi / (2 * n)
	acc_angle = math.pi - angle
	ang = acc_angle
	side = 0
	while ang < math.pi / 2:
		side += math.cos(ang)
		ang += acc_angle
	print(side * 2 + 1)


import sys
import math
input = sys.stdin.readline
n = int(input())
for i in range(n):
	s = 1
	n = 2 * int(input())
	pi = math.pi
	a = s / (2 * math.tan(pi / n))
	print(2 * a)


tc = int(input().strip())
import math

def solve():
	n = int(input().strip())
	theta = 360 / (4 * n)
	if n % 2 == 0:
		return 2 * (0.5 / math.tan(math.radians(theta)))
	else:
		return 2 * (0.5 / math.sin(math.radians(theta)))
for i in range(1, tc + 1):
	ans = solve()
	print(ans)


import math
t = int(input())
a = 1
for t0 in range(t):
	n = int(input())
	N = 2 * n
	if n % 2 == 1:
		diag = 2 * (math.cos(math.pi / N) - math.sin(math.pi / N)) + a / math.sin(math.pi / N)
		stor = diag / 2 ** 0.5
	if n % 2 == 0:
		stor = 2 * (1 / (2 - 2 * math.cos(2 * math.pi / N)) - 1 / 4) ** 0.5
	print(stor)


import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *

class Scanner:

	@staticmethod
	def int():
		return int(sys.stdin.readline().rstrip())

	@staticmethod
	def string():
		return sys.stdin.readline().rstrip()

	@staticmethod
	def map_int():
		return [int(x) for x in Scanner.string().split()]

	@staticmethod
	def string_list(n):
		return [Scanner.string() for i in range(n)]

	@staticmethod
	def int_list_list(n):
		return [Scanner.map_int() for i in range(n)]

	@staticmethod
	def int_cols_list(n):
		return [Scanner.int() for i in range(n)]

class Math:

	@staticmethod
	def gcd(a, b):
		if b == 0:
			return a
		return Math.gcd(b, a % b)

	@staticmethod
	def lcm(a, b):
		return a * b // Math.gcd(a, b)

	@staticmethod
	def divisor(n):
		res = []
		i = 1
		for i in range(1, int(n ** 0.5) + 1):
			if n % i == 0:
				res.append(i)
				if i != n // i:
					res.append(n // i)
		return res

	@staticmethod
	def round_up(a, b):
		return -(-a // b)

	@staticmethod
	def is_prime(n):
		if n < 2:
			return False
		if n == 2:
			return True
		if n % 2 == 0:
			return False
		d = int(n ** 0.5) + 1
		for i in range(3, d + 1, 2):
			if n % i == 0:
				return False
		return True

def pop_count(x):
	x = x - (x >> 1 & 6148914691236517205)
	x = (x & 3689348814741910323) + (x >> 2 & 3689348814741910323)
	x = x + (x >> 4) & 1085102592571150095
	x = x + (x >> 8)
	x = x + (x >> 16)
	x = x + (x >> 32)
	return x & 127
MOD = int(1000000000.0) + 7
INF = int(1000000000000000.0)

def solve():
	N = Scanner.int()
	n = 2 * N
	X = math.tan(math.pi / n)
	X = 1 / X
	print(X)

def main():
	T = Scanner.int()
	for _ in range(T):
		solve()
main()


import math
from math import sin
import collections
from sys import stdin, stdout, setrecursionlimit
import bisect as bs
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	print(1 / math.tan(math.pi / (2 * n)))


from math import sin, cos, pi
n = int(input())

def f(a, b):
	return sin(b * pi / a) / sin(pi / a)
for _ in range(n):
	m = int(input())
	print('%.12f' % (f(2 * m, m) * cos(pi / (4 * m))))


import math as mt
for _ in range(int(input())):
	n = int(input())
	if n == 2:
		print('1.000000')
		continue
	angle = mt.pi / (2 * n)
	val = 1 / mt.tan(angle)
	print(val)


import sys
import math
input = sys.stdin.readline

def main():
	t = int(input())
	for _ in range(t):
		N = int(input())
		x = (N - 2) // 2
		ans = 0.5
		a = 1 / 2 * math.tan(math.pi * (N * 2 - 2) / (2 * 2 * N))
		print(a * 2)
main()


import math
k = int(input())
for i in range(k):
	m = int(input())
	m = math.pi / (2 * m)
	print(math.cos(m) / math.sin(m))


import sys, math, os
from io import BytesIO, IOBase
from bisect import bisect_left as bl, bisect_right as br, insort
from collections import defaultdict as dd, deque, Counter

def data():
	return sys.stdin.readline().strip()

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write(' '.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
sys.setrecursionlimit(100000)
INF = float('inf')
mod = int(1000000000.0) + 7

def main():
	for t in range(int(data())):
		n = int(data())
		if n % 2 == 0:
			print(1 / math.tan(90 / n * math.pi / 180))
		else:
			print(1 / math.cos(90 / n * math.pi / 180))
main()


import math

def solution():
	n = int(input())
	theta = 2 * math.pi / (2 * n)
	height = 0.0
	for i in range(1, n // 2):
		height += math.sin(theta * i)
	height = height * 2 + 1
	print(height)
T = int(input())
for t in range(T):
	solution()


import math
import sys
input = sys.stdin.readline
(T,) = map(int, input().split())
for t in range(T):
	n = int(input())
	print(1 / math.tan(math.pi / (2 * n)))


import math
t = int(input())
for i in range(t):
	n = 2.0 * float(input())
	y = 0.0
	t = 135.0 + 90.0 * (n - 2.0) / n
	delta = 180.0 - (n - 2.0) * 180.0 / n
	minY = 10000000
	maxY = -10000000
	for i2 in range(int(n)):
		y = y + math.sin(math.radians(t))
		t = (t + delta) % 360.0
		minY = min(minY, y)
		maxY = max(maxY, y)
	print(round(maxY - minY, 7))


from math import *
for i in range(int(input())):
	a = int(input())
	y = tan(pi / (2 * a))
	print(1 / y)


import sys
from math import cos, radians

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
for _ in range(INT()):
	N = INT()
	M = N // 2
	each = 90 / M
	ans = 1
	dig = each
	for i in range(M - 1):
		ans += cos(radians(dig)) * 2
		dig += each
	print(ans)


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
import sys
import random
from queue import PriorityQueue
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import heapq
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop
from itertools import permutations
from math import factorial as f

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p
import sys
from math import tan, pi
t = int(input())
for _ in range(t):
	n = int(input())
	print(1 / tan(pi / (2 * n)))


import sys, random, math
from bisect import bisect_left, bisect_right
input = sys.stdin.readline

def main():
	inf = 10 ** 20
	t = int(input())
	for _ in range(1, t + 1):
		n = int(input())
		n *= 2
		angle = 2 * math.pi / (2 * n)
		print(0.5 / math.tan(angle) * 2)
main()


import math

def solve(n):
	if n == 2:
		return 1.0
	each_angle = math.pi / n
	height = 0
	width = 0
	for i in range(n):
		angle = each_angle * i
		height += math.sin(angle) * 1.0
		width += abs(math.cos(angle)) * 1.0
	return max(height, width)

def main():
	T = int(input())
	for _ in range(1, T + 1):
		n = int(input())
		print(solve(n))
main()


import math

def modinv(n, p):
	return pow(n, p - 2, p)

def main():
	for case in range(int(input())):
		n = int(input())
		n *= 2
		r = 0.5 / math.sin(180 / n * (math.pi / 180))
		r *= 2
		print(math.sqrt(r ** 2 - 1))
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import math
import functools

def apothem(n):
	return 1 / (2 * math.tan(math.radians(180 / (2 * n))))

def length(apo):
	return (apo ** 2 + (1 / 2) ** 2) ** (1 / 2)

def s():
	n = int(input())
	apo = apothem(n)
	piz_len = length(apo)
	print('{:.9f}'.format(min(2 * apo, 2 * piz_len)))
t = int(input())
for i in range(t):
	s()


from math import *
t = int(input())
for i in range(t):
	ans = 0
	n = int(input())
	first = pi / n
	Id = pi / n
	for j in range(n // 2):
		ans += cos(first)
		first += Id
	ans *= 2
	ans += 1
	print('%.9f' % ans)


import math

def area(length):
	return length / (4 * math.tan(180 / length * (math.pi / 180)))
T = int(input())
for _ in range(T):
	N = int(input())
	n = 2 * N
	perimeter = n
	a = area(n)
	ans = 4 * (a / perimeter)
	print(ans)


solution = {3: 1.9318516566168684, 5: 3.1962266154895227, 7: 4.465702138555225, 9: 5.736856625445605, 11: 7.008771027108681, 13: 8.281093792726105, 15: 9.553661307773872, 17: 10.826387082930989, 19: 12.099221095538162, 21: 13.37213239223544, 23: 14.645100801220043, 25: 15.91811260829573, 27: 17.191158165121383, 29: 18.46423048630482, 31: 19.737324389919028, 33: 21.01043595073844, 35: 22.28356214103188, 37: 23.55670058790705, 39: 24.82984940774907, 41: 26.10300707771331, 43: 27.3761723648695, 45: 28.649344253436915, 47: 29.922521900564597, 49: 31.195704601032457, 51: 32.46889176025982, 53: 33.742082873426554, 55: 35.01527750915028, 57: 36.288475296600815, 59: 37.5616759152356, 61: 38.83487908655478, 63: 40.108084567427035, 65: 41.38129214464761, 67: 42.65450163047119, 69: 43.9277128589218, 71: 45.200925682726385, 73: 46.474139970752574, 75: 47.747355608353246, 77: 49.02057248549742, 79: 50.29379051040848, 81: 51.567009598062775, 83: 52.84022967163215, 85: 54.11345066151974, 87: 55.38667250452869, 89: 56.659895143143025, 91: 57.93311852490338, 93: 59.20634260186318, 95: 60.47956733011363, 97: 61.75279266936748, 99: 63.02601858259308, 101: 64.29924503569211, 103: 65.57247199721473, 105: 66.84569943810742, 107: 68.11892733148889, 109: 69.3921556524509, 111: 70.6653843778804, 113: 71.93861348630078, 115: 73.21184295772943, 117: 74.48507277355019, 119: 75.75830291639832, 121: 77.0315333700573, 123: 78.30476411936536, 125: 79.57799515013099, 127: 80.85122644905681, 129: 82.12445800367001, 131: 83.39768980225952, 133: 84.6709218338187, 135: 85.94415408799317, 137: 87.21738655503323, 139: 88.49061922575028, 141: 89.76385209147706, 143: 91.03708514403127, 145: 92.31031837568199, 147: 93.58355177911906, 149: 94.8567853474248, 151: 96.13001907652828, 153: 97.4032529552281, 155: 98.67648698014948, 157: 99.94972114570429, 159: 101.22295544658557, 161: 102.49618987775007, 163: 103.76942443440196, 165: 105.04265911197807, 167: 106.3158939061338, 169: 107.58912881273005, 171: 108.86236382782165, 173: 110.1355989476456, 175: 111.40883416861115, 177: 112.68206948728968, 179: 113.95530490040586, 181: 115.22854040482915, 183: 116.50177599756584, 185: 117.7750116757517, 187: 119.04824743664504, 189: 120.32148327762013, 191: 121.59471919616135, 193: 122.86795518985727, 195: 124.14119125639549, 197: 125.41442739355739, 199: 126.68766359921355}
for _ in range(int(input())):
	print(solution[int(input())])


import math
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		b = 1 / 2 / math.sin(math.pi / (2 * n)) * math.sin(math.pi * (n - 1) / (2 * n))
	else:
		b = 1 / math.sin(2 * math.pi / (2 * n)) * math.sin(2 * math.pi * (n - 1) / (2 * n))
	print(2 * b)


import collections
import operator
import math
for _ in range(int(input())):
	a = int(input())
	ans = 1 / math.tan(math.pi / (2 * a))
	print(ans)


import math
t = int(input())
for _ in range(t):
	x = int(input())
	x = math.pi / (2 * x)
	print(math.cos(x) / math.sin(x))


from math import tan, pi

def polyapothem(n, a):
	return 2.0 * (a / (2 * tan(180.0 / n * pi / 180.0)))
for __ in range(int(input())):
	nn = int(input())
	print(polyapothem(nn * 2, 1))


import os
import sys
from io import BytesIO, IOBase
import heapq as h
from bisect import bisect_left, bisect_right
from types import GeneratorType
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import defaultdict as dd, deque as dq
import math, string

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())
MOD = 10 ** 9 + 7
from bisect import bisect_left

def solve():
	N = getInt()
	curr = 0
	for i in range((N - 1) // 2):
		ang = (i + 1) * math.pi / N
		curr += math.cos(ang)
	curr *= 2
	curr += 1
	return curr
for _ in range(getInt()):
	print(solve())


from math import tan

def Inscribed(n):
	r = 1 / (2 * tan(180 / n * 3.1415926535 / 180))
	return r
for _ in range(int(input())):
	n = int(input())
	if n == 2:
		print(1.0)
		continue
	print('{0:.12}'.format(2 * Inscribed(2 * n)))


from math import radians, tan
for tt in range(int(input())):
	n = int(input())
	n = n * 2
	rad = radians((n - 2) * 90 / n)
	print(tan(rad))


import math
t = int(input())

def fun(n):
	n = 2 * n
	r = 1
	pi = math.pi
	r = 1 / math.tan(pi / n)
	print(r)
while t:
	t -= 1
	n = int(input())
	fun(n)


n = int(input())
from math import *
for x in range(n):
	q = int(input())
	print(cos(pi / (4 * q)) / sin(pi / (2 * q)))


import sys
from math import pi, sin

def I():
	return sys.stdin.readline().rstrip()

def h(n):
	m = n // 2 - 1
	a = 1
	return a * sin(pi * m / n) / sin(pi / n)

def main():
	for tc in range(1, 1 + int(I())):
		n = int(I())
		n *= 2
		print(h(n))
main()


import math
test = int(input())
while test > 0:
	n = int(input())
	r = math.radians(180 * (2 * n - 2) / (4 * n))
	print(math.tan(r))
	test -= 1


from sys import stdin
input = lambda : stdin.readline().strip()
from math import ceil, sqrt, factorial, gcd, tan, sin, pi
from collections import deque
for _ in range(int(input())):
	n = int(input())
	print(1 / (2 * sin(pi / (4 * n))))


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
mod = 1000000007
import math
import bisect
abc = 'abcdefghijklmnopqrstuvwxyz'
pi = 3.141592653589793

def main():
	for _ in range(ii()):
		n = ii()
		ans = math.cos(pi / (2 * n)) / math.sin(pi / (2 * n))
		print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import math
t = int(input())
while t != 0:
	t -= 1
	n = int(input())
	n = 2 * n
	p = (n - 2) * 180.0
	p /= n
	p /= 2.0
	k = math.tan(p * math.pi / 180.0)
	print(k)


import math
for _ in range(int(input())):
	n = int(input())
	g = 2 * n
	x = math.pi / g
	y = math.tan(x)
	a = 1 / (2 * y)
	print(2 * a)


import math
numOfRecords = input()
for i in range(0, int(numOfRecords)):
	noOfSides = int(input())
	ans = 1 / (2 * math.sin(math.pi / (4 * noOfSides)))
	print(ans)


import math
t = int(input())
for _ in range(t):
	n = int(input())
	n *= 2
	angle = 360 / n
	ans = 1
	n //= 2
	angle *= math.pi
	angle /= 180
	temp = angle
	while angle < 90 * 0.0174533:
		ans += math.sin(angle) * 2
		angle += temp
	print(ans - 2)


import math

def f(x):
	n = 2 * x / 4 - 0.5
	t = (2 * x - 2) * 180 / (2 * x)
	al = [t - 90]
	for i in range(int(n)):
		al.append(al[-1] + t - 180)
	summ = 0
	for i in range(len(al) - 1):
		summ = summ + math.cos(math.radians(al[i]))
	summ = summ + 1 / 2 * math.cos(math.radians(al[-1]))
	return 2 * summ
for tc in range(int(input())):
	x = int(input())
	print(f(x))


import sys
import math

def read_integer():
	return int(sys.stdin.readline())

def read_integers():
	return [int(x) for x in sys.stdin.readline().split(' ')]

def print_integers(nums):
	print(' '.join([str(x) for x in nums]))

def func():
	n = read_integer() * 2
	r = math.sin(math.pi / n)
	m = n // 2 - 1
	lm = 1 * math.sin(m * math.pi / n) / math.sin(math.pi / n)
	return lm
nt = read_integer()
for _ in range(nt):
	print(func())


import math
t = int(input())
for i in range(0, t):
	n = int(input())
	if n == 2:
		print(1)
	else:
		a = 0
		for j in range(2, n, 2):
			a += math.cos(j / 2 * (n - 1) * math.pi / n - (j - 1) * math.pi / 2)
		print(a * 2 + 1)


import math
for i in range(int(input())):
	n = int(input())
	if n == 2:
		print('1.000000000')
	else:
		j = 1
		ext_ang = 180 / n
		ans = 0
		while j <= n - 1:
			angle = j * ext_ang
			ans += math.sin(angle * math.pi / 180)
			j += 1
		print('{0:.9f}'.format(ans))


import math
T = int(input())
while T:
	n = int(input())
	if n % 2 == 0:
		rad = 0.0174533
		internal_angle = (n - 1) * 180 * 1.0 / (n * 1.0)
		prevAngle = 0
		ans = 1.0
		while True:
			cur_angle = 180 - internal_angle + prevAngle
			prevAngle = cur_angle
			co = math.cos(cur_angle * rad)
			if co <= 0:
				break
			ans = ans + 2.0 * co
		print(ans)
	else:
		angle = math.pi / n / 4
		ans = 0.5 / math.sin(angle)
		print(ans)
	T -= 1


import sys
from math import pi, sin, cos
input = sys.stdin.readline
t = int(input())
for i in range(t):
	n = 2 * int(input())
	R = 1 / (2 * sin(pi / n))
	r = R * cos(pi / n)
	print(2 * r)


from math import radians, sin, cos
t = int(input())
for _ in range(t):
	n = int(input())
	alpha = radians(90 / n)
	r = 0.5 / sin(alpha)
	beta = 180 * (n // 2) / n
	gamma = radians((90 - beta) / 2)
	d = r * cos(gamma)
	print(2 * d)


import sys
from math import *
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	n *= 2
	print(cos(pi / (2 * n)) / sin(pi / n))


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
from math import tan, pi

def polyapothem(n, a):
	if a < 0 and n < 0:
		return -1
	return a / (2 * tan(180 / n * pi / 180))

def gift():
	for _ in range(t):
		n = int(input())
		yield '{0:.12}'.format(2 * polyapothem(n * 2, 1))
t = int(input())
ans = gift()
print(*ans, sep='\n')


import math
t = int(input())
for _ in range(t):
	qty = float(input())
	if qty == 2:
		print('1.000000000')
	else:
		angulo = 360 / (4 * qty)
		co = 1 / math.tan(2 * math.pi * (angulo / 360))
		print(co)


import sys
import math as mt
import bisect
t = int(input())
for __ in range(t):
	n = int(input())
	n = 2 * n
	a = mt.pi / n
	d = mt.cos(a) / mt.sin(a)
	print(d)


import math
n = int(input())
for _ in range(n):
	x = int(input())
	theta = math.pi / (2.0 * x)
	a = 1.0 / math.tan(theta)
	print(a)


from math import tan, radians
for _ in range(int(input())):
	n = int(input()) * 2
	angle = (n - 2) * 90 / n
	print(tan(radians(angle)))


import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys
T = int(input())
for t in range(T):
	n = int(input())
	x = 1.0 / (2.0 * math.tan(math.pi / (n * 2.0)))
	print('{:.20f}'.format(2 * x))


import math

def parse():
	return int(input())
t = int(input())
for i in range(0, t):
	n = float(parse())
	print(math.cos(math.pi / (4.0 * n)) / math.sin(math.pi / (2.0 * n)))


from math import radians, tan
t = int(input())
for _ in range(t):
	n = int(input())
	alpha = radians(90 / n)
	h = 0.5 / tan(alpha)
	print(2 * h)


import sys, math
readline = sys.stdin.readline

def solve():
	N = int(readline())
	ans = 1 / math.tan(math.pi / (2 * N))
	print(ans)
T = int(readline())
for i in range(T):
	solve()


import math
r = math.pi
for _ in range(int(input())):
	N = int(input())
	w = 2 * N
	t = math.cos(r / w) / math.sin(r / w)
	print(t)


import math
n = int(input())
for i in range(n):
	g = int(input())
	u = math.tan(math.pi / (2 * g))
	if g % 2 == 0:
		print('%.9f' % (1.0 / u))
	else:
		print('%.9f' % math.hypot(u, 0.5))


from decimal import *
import math
t = int(input())
getcontext().prec = 12
for tests in range(t):
	n = int(input())
	crad = 1 / 2 / math.sin(90 / n * math.pi / 180)
	ans = 2 * crad * math.cos(math.pi / 4 / n)
	print(ans)


from math import pi, cos, tan
for _ in range(int(input())):
	n = 2 * int(input())
	angle = (pi - 2 * pi / n) / 2
	line_dist = tan(angle) / 2
	point_dist = 1 / (2 * cos(angle))
	print(2 * min(line_dist, point_dist))


import math
t = int(input())
for i in range(t):
	n = int(input())
	a = 2 * n / (4 * math.tan(3.141592653589793 / (2 * n))) / (n / 2)
	print(a)


from math import *
import sys
sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

def MI():
	return map(int, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]

def main():
	for _ in range(II()):
		n = II()
		a = 0.5 / sin(pi / n / 2)
		r = (pi / 2 - pi * (n // 2) / n) / 2
		ans = a * cos(r) * 2
		print(ans)
main()


import math, sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input()) * 2
	if n == 4:
		print(1)
	else:
		large_angle = (n - 2) * 180 / n / 2
		small_angle = 180 - 2 * large_angle
		alt = math.sin(math.radians(large_angle)) / math.sin(math.radians(small_angle))
		print(math.sqrt(alt ** 2 - 0.5 ** 2) * 2)


from math import tan, radians
from sys import stdin
input = iter(stdin.readlines()).__next__
t = int(input())
for _ in range(t):
	n = 2 * int(input())
	print(1 / tan(radians(180 / n)))


import math
t = int(input())
for i in range(t):
	x = int(input())
	ans = float(0)
	ans = math.cos(math.pi / 4 / x) / math.sin(math.pi / 2 / x)
	template = '{:.' + str(6) + 'f}'
	print(template.format(ans))


import math
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	ans = math.cos(math.pi / (4 * n)) / math.sin(math.pi / (2 * n))
	print('%.8f' % ans)


import sys
import math
from collections import deque
for _ in range(int(input())):
	n = int(input())
	ang = math.pi - math.pi / n
	toRem = math.pi / 2
	l = 0
	for i in range((2 * n - 1) // 4):
		a1 = ang - toRem
		a2 = math.pi / 2 - a1
		l += math.sin(a1)
		toRem = a2 + math.pi / 2
	print(2 * l + 1)


from sys import stdin
from collections import Counter, deque
import math
T = int(input())
for _ in range(T):
	n = int(input()) * 2
	p = math.radians(180 * (n - 2) / n / 2)
	h = math.sin(p) / (2 * math.cos(p))
	print('%.9f' % (h * 2))


import math
t = int(input())
while t:
	t -= 1
	n = int(input())
	n = 2 * n
	a = math.pi / n
	c = 2 * n
	b = math.pi / c
	x = 1 / math.sin(a) * math.cos(b)
	print('%.9f' % x)


import math
PI = 3.141592653589793

def check(radius, half, start, n):
	for i in range(n // 2):
		x = math.cos(start + 2 * PI * i / n)
		y = math.sin(start + 2 * PI * i / n)
		if abs(x) > half / radius or abs(y) > half / radius:
			return False
	return True
t = int(input().strip())
for _ in range(t):
	n = int(input().strip())
	radius = 0.5 / math.sin(PI / (2 * n))
	left = 0.0
	right = 500.0
	epsilon = 1e-09
	c = None
	while abs(right - left) > epsilon:
		c = (right + left) / 2
		half = c / 2.0
		if radius <= half:
			right = c
		else:
			angle = math.acos(half / radius)
			if check(radius, half, angle, 2 * n):
				right = c
			else:
				left = c
	print(f'{c:.15f}')


import math
xm = int(input())
for rt in range(xm):
	n = int(input())
	n *= 2
	p = math.pi
	t = math.tan(p / n)
	print(1 / t)


import math
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		ans = math.tan(math.pi / (2 * n))
	else:
		ans = math.sin(math.pi / (2 * n))
	print(1 / ans)


import math
t = int(input())
while t:
	t -= 1
	n = int(input())
	n = 2 * n
	a = math.pi / n
	x = math.sqrt((1 / math.sin(a)) ** 2 - 1)
	print('%.9f' % x)


from math import tan
t = int(input())
for i in range(t):
	n = int(input())
	n = 2 * n
	tg = 360 / (2 * n) * 0.0174533
	ans = 1 / tan(tg)
	print(ans)


import sys
import os
import heapq
import math
try:
	path = './file/input.txt'
	if os.path.exists(path):
		sys.stdin = open(path, 'r')
except:
	pass
t = int(input())

def printd(value):
	pass

def case():
	n = int(input())
	result = 1 / math.tan(math.pi * 2 / (n * 4))
	print(result)
for _ in range(t):
	case()


ipnl = lambda n: [int(input()) for _ in range(n)]
inp = lambda : int(input())
ip = lambda : [int(w) for w in input().split()]
import math
for _ in range(inp()):
	n = inp()
	n *= 2
	d = 1 / math.sin(math.pi / (2 * n))
	r = d / 2
	print(r)


from math import sin
import math

def gen(n, off):
	ret = []
	rd = 1 / sin(math.pi / n) / 2
	for i in range(0, n):
		ang = i * 2 * math.pi / n + off
		ret.append((rd * math.sin(ang), rd * math.cos(ang)))
	y = []
	x = []
	for (i, j) in ret:
		y.append(j)
		x.append(i)
	return max(max(y) - min(y), max(x) - min(x))

def solve(n, steps):
	ans = 1000000000
	for i in range(0, steps):
		ans = min(ans, gen(n, i * 2 * math.pi / steps))
	return ans
anss = [0, 0, 0, 1.9318516525781373, 0, 3.1962266107498305, 0, 4.465702135190254, 0, 5.736856622834928, 0, 7.0087710228420494, 0, 8.281093789118493, 0, 9.553661304648701, 0, 10.826387080174317, 0, 12.099221090606225, 0, 13.372132387773902, 0, 14.645100797146942, 0, 15.918112604548813, 0, 17.191158161652258, 0, 18.464230483075127, 0, 19.73732438689784, 0, 21.01043594790047, 0, 22.283562138356153, 0, 23.55670058537602, 0, 24.829849402946728, 0, 26.10300707314532, 0, 27.376172360514044, 0, 28.649344249275096, 0, 29.922521896579926, 0, 31.19570459721047, 0, 32.46889175658776, 0, 33.742082869893075, 0, 35.015277505745324, 0, 36.28847529331536, 0, 37.561675912061524, 0, 38.8348790834848, 0, 40.10808456445453, 0, 41.38129214176658, 0, 42.654501627676176, 0, 43.927712856207805, 0, 45.20092568008885, 0, 46.47413996818731, 0, 47.747355603359544, 0, 49.02057248063344, 0, 50.293790505667644, 0, 51.567009593439025, 0, 52.84022966711982, 0, 54.113450657113596, 0, 55.38667250022384, 0, 56.65989513893493, 0, 57.93311852078776, 0, 59.206342597836084, 0, 60.47956732617132, 0, 61.75279266550647, 0, 63.02601857881007, 0, 64.29924503198401, 0, 65.57247199357865, 0, 66.84569943454058, 0, 68.11892732798874, 0, 69.39215564901495, 0, 70.66538437450639, 0, 71.93861348298647, 0, 73.21184295447277, 0, 74.4850727703492, 0, 75.75830291325114, 0, 77.03153336696215, 0, 78.30476411632051, 0, 79.57799514713489, 0, 80.85122644610787, 0, 82.12445800076682, 0, 83.39768979940064, 0, 84.67092183100281, 0, 85.944154085219, 0, 87.21738655229956, 0, 88.49061922305593, 0, 89.76385208882094, 0, 91.0370851414123, 0, 92.31031837309914, 0, 93.58355177657134, 0, 94.8567853449113, 0, 96.13001907156787, 0, 97.40325295033253, 0, 98.67648697531706, 0, 99.94972114093346, 0, 101.22295544187475, 0, 102.49618987309775, 0, 103.76942442980675, 0, 105.04265910743855, 0, 106.31589390164861, 0, 107.58912880829797, 0, 108.8623638234414, 0, 110.13559894331601, 0, 111.40883416433104, 0, 112.68206948305792, 0, 113.95530489622139, 0, 115.22854040069092, 0, 116.50177599347283, 0, 117.77501167170296, 0, 119.04824743263958, 0, 120.32148327365707, 0, 121.59471919223978, 0, 122.86795518597636, 0, 124.14119125255439, 0, 125.41442738975526, 0, 126.68766359544964, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

def solve(n):
	return anss[n]
n = int(input())
for i in range(n):
	print(solve(int(input())))


import math as mt

def polydiagonal(n):
	l = 1
	n = n * 2
	ans = 0
	ans = round(1 / mt.sin(mt.radians(180 / n)), 9)
	ans2 = round(1 / mt.tan(mt.radians(180 / n)), 9)
	if ans2 == 1:
		return 1
	return ans2
for _ in range(int(input())):
	print(polydiagonal(int(input())))


from math import tan
from math import pi
t = int(input())
while t:
	n = int(input())
	alpha = pi * 2 / (2 * n)
	l = tan((pi - alpha) / 2)
	print('%.10lf' % l)
	t -= 1


import math
t = int(input())
for test in range(t):
	n = int(input())
	h = 1 / (2 * math.sin(math.pi / (2 * n)))
	print(2 * h * math.cos(math.pi / (2 * n)))


import math
(x, y) = ([], [])
for _ in range(int(input())):
	n = int(input())
	ans = 1 / math.tan(math.pi / (2 * n))
	x.append(n)
	y.append(ans)
	print(ans)


import math
from sys import stdin, stdout
for _ in range(int(stdin.readline().strip())):
	n = 2 * int(stdin.readline().strip())
	ans = 1 / math.tan(math.radians(180 / n))
	print('{0:.9f}'.format(ans))


import math
t = int(input())
for w in range(t):
	n = int(input())
	s = 1
	print(math.sqrt(pow(1 / math.sin(math.pi / (2 * n)), 2) - 1))


import math
t = int(input())
for i in range(t):
	n = float(input())
	n *= 2
	ext = 0
	internal = (n - 2) * 180 / n
	theta = internal - 90
	for j in range(int(n // 4) - 1):
		ext += math.sin(math.radians(theta))
		theta = internal - 180 + theta
	res = 1 + 2 * ext
	print(res)


import math
for _ in range(int(input())):
	s = int(input())
	s = s * 2
	apothem = 1 / (2 * math.tan(math.radians(180 / s)))
	t = math.sqrt(apothem ** 2 + 0.5 ** 2)
	angle = math.radians(360 / s / 4)
	ans = 2 * t * math.cos(angle)
	print(ans)


from sys import stdin, stdout
from math import cos, sin, pi, tan
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
tc = ii1()
for _ in range(tc):
	n = ii1()
	print(1 / tan(pi / (2 * n)))


import math
T = int(input())
while T:
	n = int(input())
	m = 2 * n
	a = 90 / m
	x = 1 / math.sin(math.radians(a))
	print(x / 2)
	T = T - 1


from math import sin, radians
for _ in range(int(input())):
	n = int(input())
	print(1 / (2 * sin(radians(180 / (4 * n)))))


import math
for _ in range(int(input())):
	a = int(input())
	b = math.sin(math.pi / (4 * a))
	c = 1 / (2 * b)
	print(c)


from math import *
t = int(input())
for tests in range(t):
	n = int(input())
	n = 2 * n
	r = 1 / (2 * tan(180 / n * pi / 180)) * 2
	print('%.9f' % r)


import math
t = int(input())
for i in range(t):
	n = int(input())
	print(math.cos(math.radians(90 / n)) / math.sin(math.radians(90 / n)))


import math
t = int(input())
for i in range(t):
	n = int(input())
	n = 2 * n
	y = (n - 2) * 180 / n
	z = 180 - y
	z = z / 2
	z1 = math.radians(z)
	ans = 0.5 / math.tan(z1)
	print(ans * 2)


import math
t = int(input())
for i in range(t):
	n = int(input())
	res = 0
	for j in range(n):
		res += math.cos(math.radians(180 / n * j - 90))
	print(res)


from math import sin, sqrt
t = int(input())
for q in range(0, t):
	n = int(input())
	d = 2 / (2 * sin(360 / (4 * n) * 3.14159265 / 180))
	print(sqrt(d * d - 1))


import math
t = int(input())
for z in range(t):
	n = int(input())
	res = 2 * (1 / (2 * math.tan(90 / n * 3.1415926535 / 180)))
	print('{:.9f}'.format(res))


import math
t = int(input())
for i in range(t):
	n = float(input())
	n = n * 2
	print(math.tan(math.radians((n - 2) * 180 / (2 * n))))


import math
testCases = int(input())
tempArr = []
for i in range(testCases, 0, -1):
	num = int(input())
	ans = 0.5 / math.sin(math.asin(1) / (num * 2))
	tempArr.append(ans)
for i in tempArr:
	print(i)


import math
test = int(input())
while test > 0:
	n = int(input())
	a = 180 / (2 * n)
	p = math.pi / 180
	print(math.cos(a * p) / math.sin(a * p))
	test -= 1


import math
import sys
input = sys.stdin.readline
Q = int(input())
Query = [int(input()) for _ in range(Q)]

def get(N, theta):
	r = 1 / (2 * math.sin(math.pi / N))
	return 2 * max(r * math.cos(theta), r * math.cos(math.pi / N - theta))
for N in Query:
	if N % 2 == 0:
		print(1 / math.tan(math.pi / (N * 2)))
	else:
		N *= 2
		l1 = 0
		l2 = math.pi / N
		while l2 - l1 > 10 ** (-15):
			m1 = (2 * l1 + l2) / 3
			m2 = (l1 + 2 * l2) / 3
			s_l1 = get(N, l1)
			s_l2 = get(N, l2)
			if s_l1 >= s_l2:
				l1 = m1
			else:
				l2 = m2
		print(get(N, l1))


import math
t = int(input())
for i in range(0, t):
	n = int(input())
	if n % 2 == 1:
		pass
	else:
		if n == 2:
			print('%.9f' % 1.0)
			continue
		radius = 1 / (2 * math.sin(math.radians(90 / n)))
		ans = math.sqrt(radius * radius - 0.5 * 0.5) * 2
		print('%.9f' % ans)


import math
for i in range(int(input())):
	n = int(input())
	t = math.tan(math.pi / (2 * n))
	print(abs(1 / t))


import math
for _ in range(int(input())):
	n = int(input())
	PI = math.pi
	alpha = PI * (2 * n - 2) / (2 * n)
	beta = PI - alpha
	n1 = n // 2
	n2 = n - n1
	R = 1 / (2 * math.sin(PI / (2 * n)))
	x = R * math.sqrt(1 - math.cos(n1 * beta))
	y = R * math.sqrt(1 - math.cos(n2 * beta))
	print(x + y)


from sys import stdin, stdout
import sys
from math import *
for __ in range(int(input())):
	n = int(input())
	n = 2 * n
	temp = 1 / sin(pi / n)
	ans = sqrt(temp ** 2 - 1)
	print(ans)


import sys
import heapq
from math import *
import bisect

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, input().split())

def rlinput():
	return list(map(int, input().split()))

def srlinput(fl=False):
	return sorted(list(map(int, input().split())), reverse=fl)

def main():
	print(1 / tan(pi / (2 * iinput())))
for sdfghjkl in range(iinput()):
	main()


import math
t = int(input())
for _ in range(t):
	n = int(input())
	angle = (180 - 360 / (2 * n)) / 2
	print(math.tan(math.radians(angle)))


from math import cos, sin, pi
t = int(input())
for test in range(t):
	n = int(input())
	if n == 2:
		print(1.0)
	else:
		print(sin(pi / n) / (1 - cos(pi / n)))


import math
pi = math.pi
sin = math.sin
T = int(input())
for t in range(T):
	n = int(input())
	alpha = 2 * pi / (2 * n)
	beta = (pi - alpha) / 2
	x = sin(beta) / sin(alpha)
	print(2 * (x * math.cos(alpha / 2)))


import bisect
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq as hq
from math import tan
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate

def primeFactors(n):
	prime = set()
	while n % 2 == 0:
		prime.add(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			prime.add(i)
			n = n // i
	if n > 2:
		prime.add(n)
	return list(prime)

def getFactors(n):
	factors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				factors.append(i)
			else:
				factors.append(i)
				factors.append(n // i)
		i = i + 1
	return factors

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	num = []
	for p in range(2, n + 1):
		if prime[p]:
			num.append(p)
	return num

def lcm(a, b):
	return a * b // math.gcd(a, b)

def sort_dict(key_value):
	return sorted(key_value.items(), key=lambda kv: (kv[1], kv[0]))

def list_input():
	return list(map(int, input().split()))

def num_input():
	return map(int, input().split())

def string_list():
	return list(input())

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def binaryToDecimal(n):
	return int(n, 2)

def polyapothem(n):
	a = 1
	return a / (2 * tan(180 / n * math.pi / 180))

def solve():
	n = int(input())
	print(2 * polyapothem(2 * n))
t = int(input())
for _ in range(t):
	solve()


from math import sin, pi
for n in range(int(input())):
	x = int(input())
	if x == 2:
		print(1)
		continue
	x *= 2
	ag = (x - 2) * 180 / x
	ag = pi * ag / 180
	v = sin(ag / 2) / sin(ag)
	v *= 2
	v *= sin(ag / 2)
	print(v)


import math
from math import tan
t = int(input())
for _ in range(t):
	inn = int(input())
	inn *= 2
	a = 1
	total = a / (2 * tan(180 / inn * math.pi / 180))
	aisa = total
	aisa = aisa + total
	print(aisa)


import math
for _ in range(int(input())):
	n = int(input())
	if 2 * n % 4:
		print('%.10f' % (1 / math.sin(math.pi / (2 * n))))
	else:
		print('%.10f' % (1 / math.tan(math.pi / (2 * n))))


import math

def simplePolygonEmbedding(n):
	ans = math.tan((n - 1) * math.pi / (2 * n))
	return ans
for x in range(int(input())):
	print(simplePolygonEmbedding(int(input())))


import sys
import math
pi = math.pi
q = int(input())
for i in range(q):
	a = int(sys.stdin.readline())
	if a // 2 % 2 == 0:
		n1 = a // 2 + 1
	else:
		n1 = a // 2
	n2 = a - n1
	rad = 1 / (2 * math.sin(pi / (2 * a)))
	b = pow(2 * rad * rad - 2 * rad * rad * math.cos(2 * pi / (2 * a) * n1), 1 / 2) / pow(2, 1 / 2)
	c = pow(2 * rad * rad - 2 * rad * rad * math.cos(2 * pi / (2 * a) * n2), 1 / 2) / pow(2, 1 / 2)
	print(b + c)


import math
for q in range(int(input())):
	n = int(input())
	ans = 1 / (2 * math.sin(math.radians(180 / (4 * n))))
	print(ans)


import math
test = int(input())
for k in range(test):
	n = int(input())
	if n % 2 == 0:
		sum = 0
		for x in range(1, n):
			sum += math.sin(x * math.pi / n)
		print(sum)
	else:
		a = n // 4
		horizontal_sum = 1
		for i in range(1, a + 1):
			horizontal_sum += 2 * math.cos(i * math.pi / n)
		j = a + 1
		vertical_sum = 0
		while 2 * j < n:
			vertical_sum += math.sin(j * math.pi / n)
			j += 1
		vertical_sum *= 2
		print(round((vertical_sum + horizontal_sum) / math.sqrt(2), 9))


from math import *
from random import *
for t in range(int(input())):
	n = int(input())
	n *= 2
	an = pi * (n - 2) / n
	h = 0.5 / tan(an / 2)
	print(tan(an / 2))


import sys
import math
pi = math.pi
inf = int(1000000000000000.0)
input = sys.stdin.readline
t = int(input())
while t:
	t -= 1
	n = int(input())
	print(math.cos(pi / (4 * n)) / math.sin(pi / (2 * n)))


import math
t = int(input())
for gf in range(t):
	n = int(input())
	P = math.pi
	cos = math.cos(P / (4 * n))
	sin = math.sin(P / (2 * n))
	x = cos / sin
	print(x)


import math
t = eval(input())
while t:
	t = t - 1
	n = eval(input())
	o = math.pi / n
	ang = o
	ans = 1
	while math.cos(ang) >= 0:
		ans += 2 * math.cos(ang)
		ang += o
	print(ans)


import math
for i in range(int(input())):
	n = int(input())
	n *= 2
	ang = math.pi / n
	a = 0.5 / math.sin(ang / 2)
	print(a)


import math
for _ in range(int(input())):
	n = int(input())
	alpha = 180 / n
	ans = 1 / math.tan(math.pi / (2 * n))
	print(ans)


from decimal import *
import math
getcontext().prec = 100
pi = Decimal(0)

def init_pi():
	global pi
	for i in range(200):
		cur = Decimal(4) / Decimal(8 * i + 1) - Decimal(2) / Decimal(8 * i + 4) - Decimal(1) / Decimal(8 * i + 5) - Decimal(1) / Decimal(8 * i + 6)
		cur /= 16 ** i
		pi += cur
init_pi()

def cos(x):
	x = Decimal(x)
	getcontext().prec += 2
	(i, lasts, s, fact, num, sign) = (0, 0, 1, 1, 1, 1)
	while s != lasts:
		lasts = s
		i += 2
		fact *= i * (i - 1)
		num *= x * x
		sign *= -1
		s += num / fact * sign
	getcontext().prec -= 2
	return +s

def sin(x):
	x = Decimal(x)
	getcontext().prec += 2
	(i, lasts, s, fact, num, sign) = (1, 0, x, 1, x, 1)
	while s != lasts:
		lasts = s
		i += 2
		fact *= i * (i - 1)
		num *= x * x
		sign *= -1
		s += num / fact * sign
	getcontext().prec -= 2
	return +s

def asin(x, k=300):
	x = Decimal(x)
	l = Decimal(-pi / 2)
	r = Decimal(pi / 2)
	for i in range(k):
		mi = (l + r) / 2
		if sin(mi) < x:
			l = mi
		else:
			r = mi
	return l

def acos(x, k=300):
	x = Decimal(x)
	l = Decimal(0)
	r = Decimal(pi)
	for i in range(k):
		mi = (l + r) / 2
		if cos(mi) > x:
			l = mi
		else:
			r = mi
	return l
T = eval(input())
for i in range(T):
	n = eval(input())
	y = pi / n / 4
	x = y * 2
	print(cos(y) / sin(x))


import sys
from math import tan, pi, cos, sin
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
from itertools import islice, cycle

def go():
	n = int(input())
	nn = 2 * n
	pin = pi / nn
	(l, r) = (0, pin)
	for i in range(100):
		c = (l + r) / 2
		if cos(c) - cos(pin - c) > 0:
			l = c
		else:
			r = c
	return cos(c) / sin(pin)
t = int(input())
ans = []
for _ in range(t):
	ans.append(str(go()))
print('\n'.join(ans))


from math import sin, pi
t = int(input())
while t != 0:
	t -= 1
	n = int(input())
	k = 1 / sin(pi / (4 * n))
	print(k / 2)


import math

def rainy(N):
	return 1 / (2 * math.sin(math.pi / (4 * N)))
N = int(input())
for i in range(N):
	X = int(input())
	print(rainy(X))


t = int(input())

def solve():
	ans = [1.0, 1.0000000000048965, 2.000000000005654, 2.414213562381454, 3.2360679775095433, 3.73205080758106, 4.4939592074487065, 5.027339492141929, 5.758770483161403, 6.313751514695053, 7.026674183354025, 7.595754112749101, 8.29622981058449, 8.875245474997657, 9.56677223353534, 10.153170387640715, 10.83795144749311, 11.430052302797156, 12.10956558547868, 12.706204736214477, 13.38148999969639, 13.981826955149476, 14.65364354363252, 15.257051688313236, 15.925971109958237, 16.53197076510891, 17.1984339577779, 17.806649745405885, 18.471004054789297, 19.0811366877878, 19.743660615389683, 20.355467625050743, 21.016387900550605, 21.629670104788527, 22.289173773542153, 22.903765548502687, 23.562008724905073, 24.177770865014228, 24.834885197906797, 25.451699579436504, 26.107797111705136, 26.725562639335852, 27.380739517752733, 27.9993690008772, 28.653708347933108, 29.273126061965474, 29.92670022707008, 30.546839987039345, 31.199712331397585, 31.82051595387322, 32.47274228036004, 33.09415834339747, 33.74578805293073, 34.36777088731738, 35.0188479222017, 35.64135678408649, 36.291920403753814, 36.91491879087618, 37.565004214534554, 38.18845929714471, 38.838098239830416, 39.461980383962505, 40.111201506533725, 40.73548387221034, 41.384313161347464, 42.0089713620117, 42.65743245289564, 43.28244426520461, 43.9305587169463, 44.55590383224541, 45.20369136413321, 45.829351174627455, 46.476829869696715, 47.10278728366355, 47.74997376486666, 48.37621304630207, 49.023122629588784, 49.64962925850936, 50.29627608635629, 50.92303663664432, 51.56943379495564, 52.19643582716821, 52.84259544797215, 53.469827414966986, 54.11576076693036, 54.743211930512274, 55.38892949896682, 56.0165898560456, 56.662101413951746, 57.289961630938045, 57.93527630199021, 58.56332765635062, 59.208453971245895, 59.83668829929967, 60.48163424603983, 61.110043896213945, 61.75481696518434, 62.3833947560562, 63.028001980519, 63.65674116307005, 64.30118915562062, 64.93008337920367, 65.57437836466343, 66.20342164625373, 66.84756949140973, 67.47675618776674, 68.12076242831363, 68.75008721072905, 69.39395707572348, 70.02341490707228, 70.6671533411706, 71.2967394550178, 71.94035113873356, 72.57006102027937, 73.21355038846873, 73.84337975714152, 74.48675101589933, 75.11669580942811, 75.75995295155589, 76.3900093113742, 77.0331561305625, 77.66332038841212, 78.30636049226318, 78.9366291578812, 79.57956597988435, 80.2099357296704, 80.85277254022901, 81.48324020680019, 82.12598012339951, 82.756542685951, 83.39918868254566, 84.0298432579436, 84.67239817363554, 85.30314200817628, 85.94560855524675, 86.57643901702374, 87.2188197883759, 87.8497343602011, 88.49203183626462, 89.12302810909664, 89.76524466424017, 90.39632033107661, 91.03845823956982, 91.66961108976457, 92.3116725313268, 92.94290044529772, 93.58488751026762, 94.21618845456244, 94.85810314871894, 95.48947517141106, 96.13131942047373, 96.76276064686152, 97.4045363006953, 98.03604492928136, 98.67775376582894, 99.30932806455758, 99.9509717935203, 100.5826100962538, 101.22419036253973, 101.8558910657554, 102.49740945271263, 103.12917101240386, 103.77062904485462, 104.40244997362159, 105.04384912071146, 105.67572798502741, 106.31706966290345, 106.94900508054405, 107.59029065487361, 108.22228129249767, 108.86351208083968, 109.49555665171101, 110.13673392574913, 110.76883118758951, 111.40995617523765, 112.04210492820204, 112.68317881559018, 113.3153779003559, 113.95640183370472, 114.58865012966683, 115.22962521705821, 115.86192164062473, 116.50284895367524, 117.13519245665456, 117.77607303209827, 118.40846260017386, 119.04929744135981, 119.68173209264604, 120.32252217095677, 120.95500095463099, 121.5957472108259, 122.22826920583165, 122.86897255132116, 123.50153686513869, 124.14219818319216, 124.77480395067161, 125.41542409756433, 126.04807047981775, 126.68865028591975, 127.32133646926904]
	n = int(input())
	return ans[n - 1]
ans = []
for i in range(t):
	ans.append(solve())
for a in ans:
	print(a)


import math
for _ in range(int(input())):
	n = int(input())
	n *= 2
	y = 1 / (2 * math.sin(3.141592653589793 / (2 * n)))
	print(y)


import sys
import math
from collections import deque

def calc(f, x):
	tmp = ang / 2 + f - math.pi / 2
	return math.cos(tmp) * x
for _ in range(int(input())):
	n = int(input())
	ang = math.pi - math.pi / n
	toRem = math.pi / 2
	l = 0
	for i in range((2 * n - 1) // 4):
		a1 = ang - toRem
		a2 = math.pi / 2 - a1
		l += math.sin(a1)
		toRem = a2 + math.pi / 2
	x = 2 * l + 1
	ll = l
	z = n // 2 * math.pi / n
	print(math.cos((math.pi * 2 - math.pi / 2 - z) / 2 - math.pi / 2) * x)


import math
(MIN_INF, MAX_INF) = (float('-inf'), float('inf'))

def get_len(n, R, alpha, beta):
	(maxx, maxy) = (MIN_INF, MIN_INF)
	(minx, miny) = (MAX_INF, MAX_INF)
	d = MAX_INF
	for i in range(n):
		theta = alpha * i + beta
		x = math.cos(theta) * R
		y = math.sin(theta) * R
		maxx = max(x, maxx)
		maxy = max(y, maxy)
		minx = min(x, minx)
		miny = min(y, miny)
	d = min(d, max(abs(maxx - minx), abs(maxy - miny)))
	return d

def main():
	T = int(input())
	for t in range(T):
		n = int(input()) * 2
		alpha = 2 * math.pi / n
		R = 1.0 / 2.0 / math.sin(math.pi / n)
		print(get_len(n, R, alpha, alpha / 4))
main()


import math
for _ in range(int(input())):
	a = int(input())
	b = math.tan(math.pi / (2 * a))
	c = 1 / b
	d = round(c, 9)
	print(d)


import math
for _ in range(int(input())):
	n = int(input())
	theta = 360 / (4 * n)
	print(2 * (0.5 / math.tan(math.radians(theta))))


import math
t = int(input())
for i in range(t):
	s = int(input())
	print(1 / (2 * math.sin(math.pi / (4 * s))))


import math
t = int(input())
pi = math.acos(-1)
sqr2 = 2 ** (1 / 2)
for i in range(t):
	n = int(input())
	step = 2 * pi / (2 * n)
	if n == 2:
		print(1.0)
		continue
	if n % 2 == 0:
		x = 0.5 / math.tan(step / 2)
		print(2 * x)
		continue
	print(ans)


import math

def main():
	n = int(input())
	if n <= 2:
		print(1)
	else:
		res = 0.5 / math.sin(math.pi / (4 * n))
		print(res)
t = int(input())
for i in range(t):
	main()


import math as deep

def rrr():
	g = int(input())
	print(1 / deep.tan(deep.pi / (2 * g)))
test = int(input())
for _ in range(1, test + 1):
	rrr()


from math import pi, sin, tan

def solution():
	n = int(input()) * 2
	return 1 / tan(pi / n)
for _ in range(int(input())):
	print(solution())


import math
p = math.pi / 2
t = int(input())
for i in range(0, t):
	n = int(input())
	x = 1 / math.tan(p / n)
	print(x)


import math
for case in range(int(input())):
	print(0.5 / math.sin(math.pi / (4 * int(input()))))


import sys
import math
from collections import defaultdict, deque
import heapq
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	sides = 2 * n
	ans = 0
	ang = math.pi / sides
	ans = 1 / math.tan(ang)
	print(ans)


import math
T = int(input())
for test in range(1, T + 1):
	n = int(input()) * 2
	ans = 1 / math.tan(math.pi / n)
	print('{:}'.format(ans))


import math
for case in range(int(input())):
	n = int(input()) * 2
	theta = math.pi / (4 * n)
	r = 0.5 / math.sin(math.pi / (2 * n))
	print(r)


from math import sin, cos, tan, pi
t = int(input())
for _ in range(t):
	n = int(input())
	n *= 2
	k = sin(pi / 2) / (sin(pi / n) * 2)
	c = k * cos(pi / n)
	s = k * sin(pi / n)
	print((s ** 2 + (k + c) ** 2) ** 0.5)


from math import sin, cos, pi
for _ in range(int(input())):
	n = int(input())
	p = sin(pi / (4 * n))
	print(0.5 / p)


import math
pi = 3.1415926536
t = int(input())

def fn():
	n = int(input())
	ans = 1 / math.tan(pi / (2 * n))
	print(ans)
while t:
	t -= 1
	fn()


from sys import stdin, stdout
import math, sys
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
import bisect as bi
import heapq

def I():
	return int(stdin.readline())

def In():
	return map(int, stdin.readline().split())

def main():
	try:
		n = I()
		print(1 / math.tan(math.radians(90 / n)))
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(I()):
	main()


import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial
from bisect import bisect_left
sys.setrecursionlimit(10 ** 7)
enu = enumerate
MOD = 10 ** 9 + 7

def input():
	return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')
from decimal import Decimal, getcontext
getcontext().prec = 1000

def solve():
	N = int(input())
	cosv = Decimal(math.cos(math.radians(180 * (2 * N - 2) / (4 * N))))
	x = 1 / (2 * cosv)
	res = 2 * x * Decimal(math.cos(math.radians(90 / N)))
	res = float(res)
	print(res)
	return
T = int(input())
for t in range(T):
	solve()


import math
t = int(input())
for _ in range(t):
	n = int(input())
	theta = math.pi / n
	if n % 2 == 0:
		print((2 / (1 - math.cos(theta)) - 1) ** 0.5)
	else:
		print((1 / (2 - 2 * math.cos(theta))) ** 0.5)


import math
for i in range(int(input())):
	a = int(input())
	b = math.pi / (2 * a)
	c = 1 / math.tan(b)
	print(c)


import math
t = int(input())
for i in range(t):
	n = int(input())
	if n == 2:
		print('%.9f' % 1.0)
	else:
		s = 2 * n
		angle = 2 * math.pi / s
		theta = (math.pi - angle) / 2
		a = math.tan(theta)
		print('%.9f' % a)


from math import sin, cos, floor, pi
for t in range(int(input().strip())):
	n = int(input().strip())
	theta = floor((n + 2) / 4) * pi / n
	ans = (sin(theta) + cos(theta)) / sin(pi / 2 / n) / 2 ** 0.5
	print(ans)


import math
import sys
from collections import defaultdict
from collections import deque
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
ilele = lambda : map(int, input().split())
alele = lambda : list(map(int, input().split()))

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]
INF = 10 ** 18
MOD = 1000000000 + 7
for _ in range(int(input())):
	N = int(input()) * 2
	a = math.cos(math.pi / (2 * N))
	b = math.sin(math.pi / N)
	print(a / b)


import math
t = int(input())
for i in range(t):
	n = int(input())
	print(2 * math.sqrt(pow(1 / (2 * math.sin(math.pi / (2 * n))), 2) - 0.25))


import math
t = int(input())
while t > 0:
	n = 2 * float(input())
	print(2 * 0.5 * math.tan((90 - 180 / n) * (math.pi / 180)), '\n')
	t -= 1


import math
for t in range(int(input())):
	n = int(input())
	k = 1
	for i in range(1, n // 2):
		k += 2 * math.cos(i * math.pi / n)
	print(k)


from math import *
mod = 10 ** 9 + 7

def _in():
	return [int(x) for x in input().split(' ')]

def main():
	n = 2 * int(input())
	ans1 = 1 / sin(pi / n)
	ans2 = 1 / tan(pi / n)
	print(min(ans1, ans2))
for _ in range(int(input())):
	main()


def getN():
	return int(input())

def getNM():
	return map(int, input().split())

def getList():
	return list(map(int, input().split()))
from collections import defaultdict, deque
from sys import exit
import math
import copy
from bisect import bisect_left
from heapq import *
import sys
INF = 10 ** 17
MOD = 998244353

def solve():
	n = getN()
	deg_each = 360 / (2 * n)
	x = 0.5
	deg = deg_each
	for i in range(n // 2):
		x += 1 * math.cos(math.radians(deg))
		deg += deg_each
	print(x * 2)

def main():
	n = getN()
	for _ in range(n):
		solve()
main()


from sys import stdin, stdout
from math import sin, pi, tan
for test in range(int(stdin.readline())):
	n = int(stdin.readline())
	ans = 1 / tan(pi / (2 * n))
	stdout.write(str(ans) + '\n')


from sys import stdin
import math

def solve(n, k):
	theta = math.pi / n
	h1 = 1 + math.cos(theta)
	h2 = 1 - math.cos(theta)
	y = math.sqrt(h1 / h2)
	print(y)
	return

def main():
	inp = stdin.readline
	for _ in range(int(inp())):
		n = int(inp())
		k = 2 * n
		solve(n, k)
main()


from math import sin, pi
n = int(input())

def f(a, b):
	return sin(b * pi / a) / sin(pi / a)
for _ in range(n):
	m = int(input())
	if m % 2 == 0:
		print('%.12f' % f(2 * m, m - 1))
	else:
		print('%.12f' % f(2 * m, m))


import math
from sys import stdin, stdout
for _ in range(int(stdin.readline().strip())):
	n = 2 * int(stdin.readline().strip())
	ans = 1 / math.sin(math.radians(90 / n))
	print('{0:.9f}'.format(ans / 2))


from math import tan

def polyapothem(n, a):
	if a < 0 and n < 0:
		return -1
	return a / (2 * tan(180 / n * 3.14159265 / 180))

def solve():
	n = int(input())
	print(2 * polyapothem(2 * n, 1))
t = int(input())
for i in range(t):
	solve()


from math import tan
from math import cos
from math import pi
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		v = tan((n - 1) * pi / (2 * n))
		print(v)
	else:
		v = 1 / cos((n - 1) * pi / (2 * n))
		r = cos(pi / (4 * n)) * v
		print(r)


import math
for _ in range(int(input())):
	m = int(input())
	m = 2 * m
	b = math.pi / m
	b1 = math.tan(b)
	b1 = 2 * (1 / (2 * b1))
	print(b1)


import math
t = int(input())
for i in range(t):
	a = float(input())
	b = 360 / (a * 4)
	c = 0.5 / math.tan(math.pi * b / 180) * 2
	print(round(c, 10))


import math
for _ in range(0, int(input())):
	n = int(input())
	theta = math.pi / n
	side = 1 / math.tan(theta / 2)
	print(side)


import math
for q in range(int(input())):
	n = int(input())
	ans = 1 / math.tan(math.radians(90 / n))
	print(ans)


T = int(input())
import math
n = [0] * T
m = [0] * T
a = [0] * T
p = [0] * T
for t in range(T):
	n = 2 * int(input())
	out = 0
	if n % 4 == 0:
		print(math.tan(math.pi / n) ** (-1))
	else:
		print(math.sin(math.pi / n) ** (-1))


import math
for _ in range(int(input())):
	n = int(input())
	a = math.pi / n
	r = 1 / math.sin(a / 2)
	print(r * math.cos(a / 4))


import math
for i in range(int(input())):
	n = int(input())
	m = 2 * n
	m1 = 2 * (n - 1)
	print(math.cos(math.pi / (2 * m)) / math.sin(math.pi * (1 / m)))


from math import sin, pi

def solve():
	n = int(input())
	return sin((n - 1) * pi / (2 * n)) / sin(pi / (2 * n))

def main():
	t = int(input())
	print('\n'.join(map(str, [solve() for _ in range(t)])))

def __starting_point():
	main()
__starting_point()


import math
T = int(input())
for i in range(T):
	n = int(input())
	p = math.pi
	ans = math.cos(p / (4 * n)) / math.sin(p / (2 * n))
	print(ans)


import math
t = int(input())
while t:
	t -= 1
	n = int(input())
	n *= 2
	a = 1
	print(round(a * math.tan((n - 2) * 180 / (2 * n) * 3.14159265358 / 180), 6))


import math
for _ in range(int(input())):
	n = int(input())
	n = 2 * n
	p = math.pi
	t = math.tan(p / n)
	ans = 1 / t
	print(ans)


import math
t = int(input())
for _ in range(t):
	n = int(input())
	smallag = 360.0 / (2 * n)
	ke = math.sqrt(0.5 / (1 - math.cos(smallag * math.pi / 180)))
	bigag = smallag * (n / 2 - 2) / 2 + smallag
	bigke = math.sqrt(2 * ke * ke * (1 - math.cos((n / 2 - 1) * smallag * math.pi / 180)))
	res = 1 + 2 * bigke * math.cos(bigag * math.pi / 180)
	print(res)


from math import cos, pi
t = int(input())
for i in range(t):
	n = int(input())
	theta = pi / n
	minX = 0
	maxX = 0
	currX = 0
	currTheta = pi / 4
	for i in range(2 * n):
		currX += cos(currTheta)
		currTheta += theta
		minX = min(currX, minX)
		maxX = max(currX, maxX)
	ans = maxX - minX
	print(ans)


import math
for i in range(int(input())):
	n = int(input())
	print(math.sqrt(math.pow(1 / math.sin(math.radians(180 / (n * 2))), 2) - 1))


import math
for _ in range(int(input())):
	n = int(input())
	z = math.pi / 180
	x = (180 - 360 / (2 * n)) / 2 * z
	print(math.tan(x))


import math
t = int(input())
for _ in range(t):
	n = int(input())
	denom = math.sin(math.radians(90 / n))
	x = (1 / denom) ** 2
	x -= 1
	print(x ** (1 / 2))


from sys import stdin, stdout
from math import sin, cos, radians, pi
t = int(input())
for _ in range(t):
	n = int(stdin.readline())
	s = 1
	R = s / 2 / sin(pi / (4 * n))
	print(R)


def getN():
	return int(input())

def getNM():
	return map(int, input().split())

def getList():
	return list(map(int, input().split()))
from collections import defaultdict, deque
from sys import exit
import math
import copy
from bisect import bisect_left
from heapq import *
import sys
INF = 10 ** 17
MOD = 998244353

def check(mid, points, origin, rotate):
	height = origin * math.cos(math.radians(rotate))
	cs = math.cos(math.radians(rotate))
	sn = math.sin(math.radians(rotate))
	for (px, py) in points:
		py = py - origin
		(rx, ry) = (px * cs - py * sn, px * sn + py * cs)
		if abs(rx) > height + 1e-07 or abs(ry) > height + 1e-07:
			return False
	return True

def solve():
	n = getN()
	deg_each = 360 / (2 * n)
	points = [(0, 0)]
	(cx, cy) = (0, 0)
	deg = deg_each / 2
	for i in range(n):
		cx += math.cos(math.radians(deg))
		cy += math.sin(math.radians(deg))
		points.append((cx, cy))
		deg += deg_each
	origin = points[-1][1] / 2
	mn = 0
	mx = deg_each
	mid = 0
	while mx - mn > 1e-07:
		rotate = (mx + mn) / 2
		if check(mid, points, origin, rotate):
			mn = rotate
		else:
			mx = rotate
	print(origin * math.cos(math.radians(rotate)) * 2)

def main():
	n = getN()
	for _ in range(n):
		solve()
main()


import sys
input = sys.stdin.readline
import math
t = int(input())
for tests in range(t):
	n = int(input())
	n *= 2
	print(1 / math.tan(math.pi / n))


import math

def answer(n):
	return round(1.0 / math.tan(math.pi / (2 * n)), 9)
t = int(input())
for i in range(t):
	n = int(input())
	print(answer(n))


from math import *
pi = 3.14159265359
for _ in range(int(input())):
	n = int(input())
	x = pi / (4 * n)
	t = cos(x)
	x *= 2
	x = sin(x)
	print(t / x)


import math
for _ in range(int(input())):
	n = int(input())
	n = 2 * n
	L = 1 / math.sin(math.pi / (2 * n)) * abs(math.sin(math.pi * (n - 1) / 4 * n))
	print(L / 2)


import math
t = int(input())
while t != 0:
	t = t - 1
	n = float(input())
	s = 2 * n
	temp1 = 180 / s
	temp1 = math.radians(temp1)
	ans2 = 0.5 / math.tan(temp1)
	print(2 * ans2)


from math import cos, pi

def grad_to_rad(grad):
	return grad / 360 * pi * 2

def mycos(grad):
	return cos(grad_to_rad(grad))

def printv(a, sep=' '):
	print(sep.join(map(str, a)))

def solve(n):
	k = 1
	N = n * 2
	q = n // 2 - 2
	ang = 180 * (N - 2) / N
	prev = 90
	for i in range(q + 1):
		cur = ang - prev
		prev = 180 - cur
		k += mycos(cur) * 2
	return k

def main():
	t = int(input())
	ans = [0] * t
	for i in range(t):
		ans[i] = solve(int(input()))
	printv(ans, '\n')
main()


from collections import defaultdict as dc
from collections import Counter
from heapq import *
import math
from bisect import bisect_left, bisect
import sys
from collections import deque as dq
from heapq import heapify, heappush, heappop
mod = 10 ** 9 + 7

def sinp():
	p = str(sys, stdin.readline())
	return p

def seive(n):
	p = [0] * (n + 1)
	for i in range(2, n):
		if p[i] == 0:
			for j in range(2 * i, n + 1, i):
				p[i] = 1
	return p

def lower_bound(a, i, n):
	return bisect_left(a, i)

def upper_bound(a, i, n):
	return n - bisect_left(a, i)

def inp():
	p = int(sys.stdin.readline())
	return p

def line():
	p = list(map(int, sys.stdin.readline().split()))
	return p

def read_mat():
	n = inp()
	a = []
	for i in range(n):
		a.append(line())
	return a

def digit(n):
	s = str(n)
	p = 0
	for i in s:
		p += int(i) ** 2
	return p

def solve(n):
	n = n * 2
	return math.tan(math.pi * (0.5 * (n - 2) / n))
t = inp()
for _ in range(t):
	n = inp()
	print(solve(n))


from math import pi, cos
T = int(input())
for _ in range(T):
	n = int(input())
	residue = 0.0
	length = 0.0
	nangle = pi * (1 - 1 / n)
	for _ in range(n // 2 - 1):
		temp = abs(nangle - pi / 2 - residue)
		length += cos(temp)
		residue = pi / 2 - temp
	print(2 * length + 1)


import math
t = int(input())

def kvadro(a, x):
	stor = 2 * (a ** 2 / (2 - 2 * math.cos(2 * math.pi / x)) - a ** 2 / 4) ** 0.5
	return stor
for t0 in range(t):
	n = int(input())
	if n % 2 == 0:
		N = 2 * n
		a = 1
	if n % 2 == 1:
		N = 4 * n
		a = (1 / (2 + 2 * math.cos(2 * math.pi / N))) ** 0.5
	print(kvadro(a, N))


import math
t = int(input())
for _ in range(t):
	n = int(input())
	print(round(2 * (1 / (2 * math.tan(math.pi / (2 * n)))), 8))


from sys import stdin, stdout
from math import sin, cos, radians
t = int(input())
for _ in range(t):
	n = int(stdin.readline())
	ext_angle = 360 / (2 * n)
	ans = 1
	num_sides_on_base = n - (1 if n % 2 == 0 else 0)
	for i in range(num_sides_on_base // 2):
		ans += 2 * sin(radians((i + 1) * ext_angle))
	print(ans)


import math
for _ in range(int(input())):
	x = 2 * int(input())
	a = math.tan(math.pi / x)
	print(1 / a)


import math
t = int(input())
for i1 in range(t):
	n = int(input())
	theta = 1 / n * math.pi
	r = math.cos(theta / 4) / math.sin(theta / 2)
	print(r)


from math import tan, pi
for _ in range(int(input())):
	a = int(input())
	t = (180 - 180 / a) / 2 * pi / 180
	print(tan(t))


import math
T = int(input())
for _ in range(T):
	n = int(input())
	angle = math.pi / n
	ans = (1 + math.cos(angle)) / math.sin(angle)
	print(ans)


import math
t = int(input())
for _ in range(t):
	n = int(input())
	n *= 2
	ia = 180 * (n - 2) / (2 * n)
	r = math.radians(ia)
	print(round(math.tan(r), 7))


from sys import stdin, gettrace
from math import pi, tan
if not gettrace():

	def input():
		return next(stdin)[:-1]

def main():

	def solve():
		n = int(input())
		angle = pi / (2 * n)
		print(1 / tan(angle))
	q = int(input())
	for _ in range(q):
		solve()
main()


import math
kl = int(input())
for l in range(kl):
	n = int(input())
	r = 1 / (2 * math.sin(math.pi / (2 * n)))
	s = 2 * r * (math.sin(n // 2 * math.pi / (2 * n)) + math.sin((n + 1) // 2 * math.pi / (2 * n))) / 2 ** 0.5
	print(s)


import math
n = int(input())
while n > 0:
	d = int(input())
	d = d * 2
	k = math.sin(3.141592 / d)
	k = 1 / k
	k = k * k
	k -= 1
	k = math.sqrt(k)
	print(k)
	n -= 1


import math

def rotate(p, angle):
	(ox, oy) = (0, 0)
	(px, py) = (p[0], p[1])
	qx = ox + math.cos(angle) * (px - ox) - math.sin(angle) * (py - oy)
	qy = oy + math.sin(angle) * (px - ox) + math.cos(angle) * (py - oy)
	return [qx, qy]

def get(P, angle):
	P_ = [rotate(p, angle) for p in P]
	(minX, minY, maxX, maxY) = (float('inf'), float('inf'), -float('inf'), -float('inf'))
	for (x, y) in P_:
		if x < minX:
			minX = x
		if x > maxX:
			maxX = x
		if y < minY:
			minY = y
		if y > maxY:
			maxY = y
	return max(maxX - minX, maxY - minY)

def solve():
	n = int(input())
	N = 2 * n
	pi = math.pi
	alpha = pi / n
	r = 0.5 / math.sin(alpha / 2)
	P = [[r * math.cos(2 * pi * i / N), r * math.sin(2 * pi * i / N)] for i in range(N)]
	(l, r) = (0, pi / (2 * n))
	while r - l > 1e-08:
		md1 = l + (r - l) / 3
		md2 = r - (r - l) / 3
		if get(P, md1) < get(P, md2):
			r = md2
		else:
			l = md1
	print(get(P, (l + r) / 2))
for _ in range(int(input())):
	solve()


import math
t = int(input())
for _ in range(t):
	n = int(input())
	theta1 = math.pi / n
	theta2 = min(abs(math.pi * (n // 4 / n - 1 / 4)), abs(math.pi * ((n // 4 + 1) / n - 1 / 4)))
	print((2 / (1 - math.cos(theta1))) ** 0.5 * math.cos(theta2))


import math
t = int(input())
root2 = 1.41421356237
for i in range(t):
	n = int(input())
	x = math.pi / n
	r = 1 / (2 * math.sin(x / 2))
	if (n + 1) % 4 == 0:
		k = (n + 1) // 4
	else:
		k = (n - 1) // 4
	l1 = root2 * r * math.sin(k * x)
	l2 = root2 * r * math.cos(k * x)
	print(l1 + l2)


import math

def parse():
	return int(input())
t = int(input())
for i in range(0, t):
	n = parse()
	alpha = (2 * n - 2) * 180 / (2 * n) / 2
	s = math.tan(alpha * math.pi / 180.0) * 0.5
	print(s * 2)


import math
t = int(input())
for _ in range(t):
	n = int(input())
	n = 2 * n
	r = 0.01745329252
	A = 360 / n * r
	x = 1 / math.tan(A / 2)
	print(x)


import math

def main():
	t = int(input())
	for i in range(t):
		solve()

def solve():
	n = 2 * int(input())
	exterior_angles = 360 / n
	rad = math.radians(exterior_angles / 2)
	print(1 / math.tan(rad))
main()


import math

def d(n):
	return 1 / math.sin(math.pi / (2 * n))

def a(n):
	return math.pi * (1 - (n // 2 + 1) / n) / 2
for _ in range(int(input())):
	n = int(input())
	print(1 / math.sqrt(2) * (d(n) * (math.cos(a(n)) + math.sin(a(n)))))


import math
t = int(input())
for i in range(t):
	x = int(input())
	ans = float(0)
	ans = math.tan(math.pi / 2 / x)
	ans = 1 / ans
	template = '{:.' + str(6) + 'f}'
	print(template.format(ans))


from math import *
import sys
sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

def MI():
	return map(int, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]

def main():
	for _ in range(II()):
		n = II()
		ans = 1 / tan(pi / 2 / n)
		print(ans)
main()


import math
ntc = 1
ntc = int(input())
for tc in range(1, ntc + 1):
	n = int(input())
	ang = math.pi / (2 * n)
	x = math.cos(ang)
	y = math.sin(ang)
	mx = x + y
	mn = x + y
	for i in range(2 * n):
		ang += math.pi / n
		x += math.cos(ang)
		y += math.sin(ang)
		mx = max(mx, x + y)
		mn = min(mn, x + y)
	print('%.12f' % ((mx - mn) / 2 ** (1 / 2)))


from math import cos, sin, pi, tan, radians

class Vector:

	def __init__(self, x=0, y=0):
		self.x = x
		self.y = y

	def dot(self, other):
		return self.x * other.x + self.y * other.y

	def scale(self, c):
		self.x *= c
		self.y *= c

	def magnitude(self):
		return self.dot(self) ** 0.5

	def rotate(self, theta):
		theta %= 360
		if theta % 90:
			theta = theta / 180 * pi
			(self.x, self.y) = (self.x * cos(theta) - self.y * sin(theta), self.x * sin(theta) + self.y * cos(theta))
		elif theta == 90:
			(self.x, self.y) = (-self.y, self.x)
		elif theta == 180:
			(self.x, self.y) = (-self.x, -self.y)
		elif theta == 270:
			(self.x, self.y) = (self.y, -self.x)
for _ in range(int(input())):
	n = 2 * int(input())
	apot = 0.5 * tan(radians((90 * n - 180) / n))
	diag = 2 * (0.25 + apot ** 2) ** 0.5
	v = Vector(diag, 0)
	u = Vector(diag, 0)
	v.rotate(90 / n)
	u.scale(u.dot(v) / u.dot(u))
	print(u.magnitude())


import math
t = int(input())
while t:
	n = int(input())
	x = math.pi / (2 * n)
	print(round(1 / math.tan(x), 9))
	t -= 1


from math import tan, pi, ceil, radians
for _ in range(int(input())):
	n = int(input())
	x = (2 * n - 2) * 180 / (2 * n)
	y = tan(radians(x / 2)) * 0.5 * 2
	print(y)


import math as ma
t = int(input())
for _ in range(t):
	n = int(input())
	print(1 / ma.tan(ma.radians(90) / n))


import math
t = int(input())
for num in range(0, t):
	n = int(input())
	a = 1 / math.tan(math.pi / (2 * n))
	print('%.9f' % a)


import math
for _ in range(int(input().strip())):
	n = int(input().strip())
	print(str(1 / math.tan(math.pi / (2 * n))))


from math import *
pi = 3.14159265358979
for _ in range(int(input())):
	n = int(input())
	l = 1 / (2 * sin(pi / (4 * n)))
	print('{:10.8f}'.format(l))


from fractions import Fraction
import bisect
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
for _ in range(iinput()):
	n = float(iinput())
	angle = math.pi / (2 * n)
	r = 0.5 / math.sin(angle)
	theta = math.pi / (2 * n)
	print(2 * r * math.cos(theta))


from math import *
for _ in range(int(input())):
	n = int(input())
	n *= 2
	ans = 1 / sin(pi / n) * cos(pi / (2 * n))
	print(ans)


import sys, math
I = sys.stdin.readline
ans = ''
for _ in range(int(I())):
	n = 2 * int(I())
	angle = math.radians((n - 2) * 180 / n / 2)
	ob = 0.5 * round(math.tan(angle), 9)
	ans += str(ob + ob) + '\n'
print(ans)


from math import sin, radians
for _ in range(int(input())):
	n = int(input()) * 2
	print(1 / (2 * sin(radians(90 / n))))


import sys
import math
input = sys.stdin.readline
for f in range(int(input())):
	n = int(input())
	alpha = 180 / n
	alpha = math.radians(alpha)
	r = 0.5 / math.sin(alpha / 2)
	r *= 2
	sol = r * math.cos(alpha / 4)
	print(sol)


import math
k = int(input())
for i in range(k):
	n = int(input())
	ans = math.tan(math.radians(90 - 90 / n))
	print(ans)


import sys
import math
pprint = lambda s: print(' '.join(map(str, s)))
input = lambda : sys.stdin.readline().strip()
ipnut = input
for i in range(int(input())):
	n = int(input())
	a = 1 / math.sin(math.pi / (2 * n)) / 2
	n *= 2
	print(a * (math.sqrt(1 - math.cos(math.pi * (n - 2) / (2 * n))) + math.sqrt(1 + math.cos(math.pi * (n - 2) / (2 * n)))))


import math

def ternary_search(left, right, n, exterior_angle):
	while True:
		left_val = calculate_side_length(left, n, exterior_angle)
		right_val = calculate_side_length(right, n, exterior_angle)
		if abs(left_val - right_val) < 1e-07 and abs(left - right) < 1e-07:
			return left_val
		left_third = left + (right - left) / 3
		right_third = right - (right - left) / 3
		if calculate_side_length(left_third, n, exterior_angle) > calculate_side_length(right_third, n, exterior_angle):
			left = left_third
		else:
			right = right_third

def calculate_side_length(alpha, n, exterior_angle):
	rad_alpha = alpha * math.pi / 180
	width = math.cos(rad_alpha)
	height = math.sin(rad_alpha)
	for i in range(n // 2):
		angle = (i + 1) * exterior_angle
		left_angle = angle - rad_alpha
		right_angle = angle + rad_alpha
		if right_angle > math.pi / 2:
			right_angle -= math.pi / 2
		width += math.cos(left_angle) + math.cos(right_angle)
		height += math.sin(left_angle) + math.sin(right_angle)
	side_length = max(width, height)
	return side_length

def main(n):
	exterior_angle = math.pi / n
	ans = ternary_search(0, 90 // n + 1, n, exterior_angle)
	print(ans)
t = int(input())
for _ in range(t):
	n = int(input())
	main(n)


import sys
from math import cos, pi
t = int(input())
for tc in range(t):
	n = int(input())
	a = cos(pi / (4 * n))
	b = cos((n - 1) * pi / (2 * n))
	print(a / b)


import math

def check(n):
	pi = math.pi
	num = math.sin(pi * (n - 1) / (2 * n))
	den = math.sin(pi / (2 * n))
	return num / den
for _ in range(int(input())):
	n = int(input())
	print(check(n))


import math as mt

def b(n, a=1):
	return 1 / (2 * mt.sin(90 / n * 3.141592653589 / 180))
t = int(input())
for _ in range(t):
	n = int(input())
	n *= 2
	print('{0:.9}'.format(b(n, 1)))


from math import pi, tan
T = int(input())
while T:
	n = int(input())
	print(1 / tan(pi / (2 * n)))
	T -= 1


import sys
import math
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input()) * 2
	x = n // 4
	a = 360 / n
	print(1 / math.tan(math.radians(a / 2)))


import math
t = int(input())
for _ in range(t):
	n = int(input())
	n = 2 * n
	x = 90 / n
	ans = 1 / (2 * math.sin(math.pi / (2 * n)))
	print(ans)


import math
t = int(input())
for i in range(t):
	n = int(input())
	a = math.tan(math.pi / (2 * n))
	b = 1 / a
	print(b)


import math
el = int(input())
for i in range(el):
	num = int(input())
	num = 2 * num
	c = 1 / (math.sin(math.radians(180 / num)) / math.cos(math.radians(90 / num)))
	print(2 * c ** 1 / 2)


import math
ntc = 1
ntc = int(input())
for tc in range(1, ntc + 1):
	n = int(input())
	ans = 0
	for i in range(n):
		ans += math.sin(i * math.pi / n)
	print('%.12f' % ans)


from math import sin
import math

def solve(n):
	dm = 1 / sin(math.pi / (2 * n)) / 2
	sd = math.sqrt(dm * dm - 0.25)
	return 2 * sd
n = int(input())
for i in range(n):
	print(solve(int(input())))