fjgk
Source: hackerearth
Difficulty: UNKNOWN_DIFFICULTY

Dominic has left his family and gone in the dark. He did it to protect his family. Sources say that he is busy in his research on prime numbers these days. People have build stories of his adventure. Some say that while roaming on the streets of Miami he saw numbers written on the street in a spiral and he observed that many prime numbers occur on both the diagonals as shown in figure below (You don't doubt his brilliant observation skills, do you?).

37 36 35 34 33 32 31
38 17 16 15 14 13 30
39 18  5  4  3 12 29
40 19  6  1  2 11 28
41 20  7  8  9 10 27
42 21 22 23 24 25 26
43 44 45 46 47 48 49

We know Dom. He cannot let any street junkie outsmart him. And so he is trying to know what percentage of prime numbers are there on both the diagonals to that to all the numbers on the diagonal. Now you know he won't directly ask you for your help but this is your chance to get his attention and be a part of the family. Show him how smart you are by writing a code to help him with this task.

NOTE: N is always an odd number.

Input: 
First line of input contains an integer t, which is the number of test cases. t lines follow, with each test containing an integer, N, which is the size of spiral matrix.

Output: 
For each test case output a single line which is the percentage of number of prime numbers on the diagonal to the total numbers on diagonal, correct to six decimal places.

Constraints :
1 ≤ t ≤10^5
3 ≤ N ≤ 10^4

SAMPLE INPUT
1
7

SAMPLE OUTPUT
61.538462

Explanation

The above spiral represents the spiral of size 7.
Numbers on the diagonal are: 37, 17, 5 ,1, 9, 25, 49, 31, 13, 3 ,7, 21, 43
Out of which prime numbers are: 37, 17, 5, 31, 13, 3, 7, 43  

61.538462% of total numbers on diagonal are prime numbers.


import math

def isPrime(n):
	if n==2:
		return 1
	if n%2==0:
		return 0
	tmp=(int)(math.sqrt(n))
	i=3
	while i<=tmp:
		if n%i==0:
			return 0
		i+=2
	return 1

a=[]
total=1
prime=0
i=2
while i<10001:
	no=(i+1)*(i+1)
	total+=4
	if isPrime(no):
		prime+=1
	no-=i
	if isPrime(no):
		prime+=1
	no-=i
	if isPrime(no):
		prime+=1
	no-=i
	if isPrime(no):
		prime+=1
	per=round(((float)(100.0)*(float)(prime)/total),6)
	a.append(per)
	i+=2

t=(int)(input())
while t:
	t-=1
	n=(int)(input())
	if n==1:
		print("60.000000")
		continue
	print("%.6f" % a[n//2-1])