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

Difficulty: interview

Starter code:

Solutions:
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
import sys

#sys.stdin = open("in.txt")

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


# solve()

T = ni()
for _ in range(T):
    solve()


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


# cook your dish here
# import sys
# sys.stdin = open('input.txt', 'r') 
# sys.stdout = open('output.txt', 'w')

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,b,c,d = list(map(int,stdin.readline().split()))
    # h = list(map(int,stdin.readline().split()))
    # b = list(map(int,stdin.readline().split()))
    # a = stdin.readline().strip('\n')
    t = 2*n
    x = math.pi/(2*t)
    h = 0.5 / (math.sin(x))
    print(round(h,7))

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())
    # a,b,c,d = map(int, input().split())
    # a = list(map(int, input().split()))
    # s = 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))


# x,s = map(int,input().split())
t = int(input())
# t = 1
ans = []
for _ in range(t):
    # print(go())
    ans.append(str(go()))
#
print('\n'.join(ans))


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

    # print(alpha*180/pi)
    # print(gamma * 180 / pi)
    res = R* 2*cos(gamma)
    print(res)

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 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
# your code goes here
for _ in range(int(input())):
	n=2*int(input())
	print(math.cos(math.pi/(2*n))/math.sin(math.pi/n))

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)


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()
    # input = lambda: sys.stdin.readline().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))
    a = math.pi / 2 / n
    tmp = 0.5 / math.sin(a)
    
    # def func(phi):
    #     return max(math.cos(phi), math.cos(a-phi))

    # l, r = 0, a
    # while l - r > 1e-10:
    #     u = func(l)
    #     v = func(r)
    #     x = func((l*2+r*1)/3)
    #     y = func((l*1+r*2)/3)

    #     if x < y:
    #         r = (l*2+r*1)/3
    #     else:
    #         l = (l*1+r*2)/3
    print(tmp * math.cos(a/2)*2)
    # print(n, tmp * func(0))
    # print(tmp * math.cos(0), tmp * math.cos(a-0))
    # print(tmp * func(l))
    # print()

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 + 1 / tan(pi / (2 * n)) / 2 ** 0.5)
        print(1 / sin(pi / (2 * n)) * cos(pi / (4 * n)))

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


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


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 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 _ in range(T):
	n = int(input())
	th = math.pi / (2*n)
	l = 1. / 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)
	# print(math.cos(th), math.sin(th+th1), th1, l, math.pi/3)


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
    # print(height, width, ans)
    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()

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

import math

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

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



# for n in range(3, 200, 2):

#     N = 2 * n

#     alpha = (2 * pi) / (2 * n)
#     beta = (pi - alpha) / 2

#     L = sin(beta) / sin(alpha)

#     ans = 10 ** 10
#     MAX = 1000
#     for i in range(MAX):
#         t0 = alpha * i / MAX

#         xx = []
#         yy = []
#         for i in range(N):
#             t = alpha * i + t0
#             x, y = L * cos(t), L * sin(t)
#             xx.append(x)
#             yy.append(y)

#         tmpr = max(max(xx) - min(xx), max(yy) - min(yy))
#         ans = min(ans, tmpr)

#     print(f"{n} : {ans},")


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

    side = math.sin(math.pi/(4*n)) * 2
    print(1/side)
    
    T -= 1

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())
for _ in range(t):
    n = int(input())
    print("{:.10f}".format(math.cos(math.pi/(4*n))/math.sin(math.pi/(2*n))))
    


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

# [int(x) for x in inp().split()]


def diagonal(x):
    return 1/(2*sin(radians(90/x)))


t = int(inp())
for _ in range(t):
    n = int(inp())
    # f = (diagonal(2*n)**2)**(1/2)
    print(diagonal(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))))


#!/usr/bin/env python3
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())

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

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

        # ans = float('inf')

        # a, b = 0, alpha
        # va, vb = get_len(n, R, alpha, a), get_len(n, R, alpha, b)

        print(get_len(n, R, alpha, alpha / 4))

        # while True:
        #     d3 = (b - a) / 3
        #     c, d = a + d3, b - d3
        #     vc, vd = get_len(n, R, alpha, c), get_len(n, R, alpha, d)

        #     if abs(vc - vd) < 1e-10:
        #         print(n, R, alpha, c, vc)
        #         break

        #     if vc < vd:
        #         b, vb = d, vd
        #     else:
        #         a, va = c, vc

main()

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

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