The statement of this problem is the same as the statement of problem C1. 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 odd integer $n$ ($3 \le n \le 199$). 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
3
5
199

Output
1.931851653
3.196226611
126.687663595

Source: codeforces | Difficulty: HARD
Tags: Geometry

Sorting

Mathematics

Complete search


Solutions:
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())


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)


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


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)


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
t = int(input())
while t != 0:
	t -= 1
	n = int(input())
	p = math.cos(math.pi / (4 * n)) / math.sin(math.pi / (2 * n))
	print(p)


import os
import sys
from io import BytesIO, IOBase
import math
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 _ in range(int(input())):
	n = int(input())
	print(1 / (2 * math.sin(math.pi / (n * 4))))


from math import pi, sin

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


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
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
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 _ in range(int(input())):
	n = int(input())
	n = n * 2.0
	ans = 1.0 / math.sin(math.pi / (2.0 * n))
	print(ans / 2)


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()


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


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)


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


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


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


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
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)


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
for ad in range(int(input())):
	n = int(input())
	n *= 2
	t = math.pi / n
	x = math.cos(t / 2) / (2 * math.sin(t))
	print(2 * x)


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))))


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 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))

def __starting_point():
	main()
__starting_point()


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()


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 tc in range(t):
	n = int(input())
	if n == 2:
		print(1)
	else:
		re = math.sin(float(3.141592653 / (n * 4)))
		a = 1 / re
		print(a / 2)


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
t = int(input())
for _ in range(t):
	n = int(input())
	print(1 / 2 / math.sin(math.pi / n / 4))


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()


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


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())
for i in range(t):
	n = int(input())
	x = math.pi / n
	y = math.pi / (4 * n)
	z = (math.pi - x) / 2
	s = math.sin(z) / math.sin(x)
	ans = 2 * s * math.cos(y)
	print(ans)


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
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 math import sin, tan, cos, pi
for t in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(1 / tan(pi / (2 * n)))
	else:
		print(1 / sin(pi / (2 * n)) * cos(pi / (4 * n)))


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 math
for _ in range(int(input())):
	x = int(input())
	print(1 / (2 * math.sin(math.pi / (4 * x))))


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
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
t = int(input())
for i in range(t):
	n = int(input())
	n = 2 * n
	a = 90 / n * 0.0174532925
	ans = 0.5 / math.sin(a)
	print('{0:.9f}'.format(ans))


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

def main():
	n = int(input())
	tht = math.pi / (2 * n)
	ans = math.cos(tht / 2) / math.sin(tht)
	print(ans)
t = int(input())
for i in range(t):
	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 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 __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 sin, pi

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


import math

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


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())
	print('{:.10f}'.format(math.cos(math.pi / (4 * n)) / math.sin(math.pi / (2 * n))))


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)


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, 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 sys
from math import pi, sin

def I():
	return sys.stdin.readline().rstrip()

def h(n):
	m = n // 2 - 0.5
	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
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)))


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)])))

def __starting_point():
	main()
__starting_point()


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
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)


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)


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)


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
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))


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])


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)))


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
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)))))


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)))


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


import os
import sys
if os.path.exists('/mnt/c/Users/Square/square/codeforces'):
	f = iter(open('D.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())
	a = math.pi / 2 / n
	tmp = 0.5 / math.sin(a)
	print(tmp * math.cos(a / 2) * 2)


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 *
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
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 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 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))


from math import *

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

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

def ternary_search(f, a, b, tol):
	while b - a >= tol:
		alpha = 1 / 3
		c = (1 - alpha) * a + alpha * b
		d = alpha * a + (1 - alpha) * b
		fc = f(c)
		fd = f(d)
		if fc < fd:
			b = d
		else:
			a = c
	return a

def f(alpha):
	x = radius * cos(alpha)
	y = radius * cos(pi / (2 * n) - alpha)
	return max(2 * x, 2 * y)
t = ri()
for i in range(t):
	n = ri()
	radius = 1 / (2 * sin(pi / (2 * n)))
	tol = 1 / 10 ** 6
	alpha = ternary_search(f, 0, pi / (2 * n), tol)
	print(f(alpha))


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))


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
(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 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
t = int(input())
ans_arr = []
for i in range(t):
	n = int(input())
	value = 0.5 / math.sin(math.asin(1) / (n * 2))
	ans_arr.append(value)
for j in ans_arr:
	print(j)


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


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 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))


from math import sin, pi, sqrt, tan

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

def read_ints():
	return list(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))


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


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
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
T = int(input())
while T != 0:
	n = int(input())
	side = math.sin(math.pi / (4 * n)) * 2
	print(1 / side)
	T -= 1


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 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 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())
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 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)


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 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 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)


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
	print(1 / (2 * sin(pi / 2 / n)))
t = 1
t = int(input())
for case in range(1, t + 1):
	ans = solve()


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, sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input()) * 2
	print(math.cos(math.pi / (2 * n)) / math.sin(math.pi / 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())
	d2 = 1 / math.sin(math.pi / (2 * n))
	d3 = d2 / 2
	angel = math.pi / n
	ans = 0
	for i in range(1, n // 2 + 1):
		na = angel * i
		b1 = d3 * (math.sin(na) + math.cos(na)) * math.sqrt(2)
		ans = max(ans, b1)
	print(ans)


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 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 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())
		print(max(0.5 / math.sin(90 / n * math.pi / 180) / math.sin(45 * math.pi / 180) * math.sin((180 - 45 - 180 / n * (n // 4 + 1)) * math.pi / 180) * 2 ** 0.5, 0.5 / math.sin(90 / n * math.pi / 180) / math.sin(45 * math.pi / 180) * math.sin((180 - 45 - 180 / n * (n // 4)) * math.pi / 180) * 2 ** 0.5))
main()


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

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())
while t > 0:
	n = int(input())
	print(1 / (2 * math.sin(math.radians(180 / (4 * n)))))
	t -= 1


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)


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


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


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)


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 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()


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())
while t:
	t -= 1
	n = int(input())
	n *= 2
	a = 1
	print(round(a / (2 * math.sin(90 / n * math.pi / 180)), 6))


from math import pi, cos, sin

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


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
pi = 3.141592653589793
t = int(input())
i = 0
while t > 0:
	n = int(input())
	n *= 2
	theta = n // 4 * (180 / n) * (pi / 180)
	x = 0.5 / math.cos((90 - 180 / n) * (pi / 180))
	print((x * math.cos(theta) + x * math.sin(theta)) * 2 ** 0.5, '\n')
	t -= 1
	i += 1


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 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)


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()


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))


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))


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
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))


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 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)


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)


import math
t = int(input())
while t > 0:
	t -= 1
	n = float(input())
	m = n
	n *= 2
	jiao = (n - 2) * 180 * 1.0 / n
	soujiao = jiao
	jiao = m // 2 * (180 - soujiao) * 1.0 / 2
	hu = (45 - jiao) / 180 * math.pi
	side = 0
	tmp = soujiao - 90
	for i in range(0, int(m / 2)):
		tmphu = tmp * 1.0 / 180 * math.pi
		side += math.sin(tmphu)
		tmp -= 180 - soujiao
	side = side * 2 + 1
	ans = side * math.cos(hu)
	print(ans)


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))


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

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


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)))


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


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)


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


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


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)


from math import pi, sin, cos
for i in range(int(input())):
	n = int(input())
	a = 0
	ans = 0
	x = pi - pi * (n - 1) / n
	for j in range(n):
		a += x
		ans += sin(a)
	print((ans ** 2 + 1) ** 0.5 * cos(x / 4))


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)


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)


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()


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


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

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)))


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 *
t = int(input())
for i in range(t):
	n = int(input())
	ans = cos(pi / (4 * n)) / sin(pi / (2 * n))
	print('%.9f' % 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 *
pi = acos(-1)
t = int(input())
while t:
	n = int(input())
	print(cos(pi / (4 * n)) / sin(pi / (2 * n)))
	t = t - 1


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)))


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


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


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

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())
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 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
for _ in range(int(input())):
	m = int(input())
	n = 2 * m
	value = 0.5 / math.sin(math.pi / (2 * n))
	print(value)


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)))))


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
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
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)))


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)


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
lister = int(input())
while lister > 0:
	n = int(input())
	lister -= 1
	temp = math.cos(math.pi / (4 * n))
	print(0.5 * temp / math.sin(math.pi / (2 * n)) * 2)


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


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, 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
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))


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)))


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


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) / 2
	res = R * 2 * cos(gamma)
	print(res)


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


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
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))


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 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)


import math
t = int(input())
for i in range(t):
	n = int(input())
	r = (n - 1) / (2 * n)
	r0 = 1 - 2 * r
	h = 1 / math.cos(r * math.pi)
	m = 0
	rec = r0
	while rec < 0.5:
		tem = h * (math.sin(rec * math.pi) + math.cos(rec * math.pi))
		m = max(m, tem)
		rec += r0
	m = m / math.sqrt(2)
	print(m)


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)


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, sin
for _ in range(val()):
	n = 2 * val()
	theta = 180 / n
	y = 1 / tan(radians(theta / 2))
	y /= 2
	x = 0.5 / sin(radians(theta / 2))
	print(x)


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)


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)))