Let's assume that 
 -  *v*(*n*) is the largest prime number, that does not exceed *n*;-  *u*(*n*) is the smallest prime number strictly greater than *n*. 
Find <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/9efda33382293068ce21371b950297a1d3ac3212.png" style="max-width: 100.0%;max-height: 100.0%;"/>.
The first line contains integer *t* (1 ≤ *t* ≤ 500) — the number of testscases. 

Each of the following *t* lines of the input contains integer *n* (2 ≤ *n* ≤ 10<sup class="upper-index">9</sup>).
import math

def prime(n):
    divisors = False
    for i in range(2, int(math.sqrt(n)) + 1):
        if n%i == 0:
            divisors = True

    if divisors == False:
        return True
    else:
        return False

def get_nums(n):
    foundIzq = False
    foundDer = False
    n_izq = n
    n_der = n
    while not (foundIzq and foundDer):
        
        foundDer = prime(n_der)
        foundIzq = prime(n_izq)
        if n_der == n:
            foundDer = False
            
        if not foundIzq:
            n_izq -= 1
        if not foundDer:
            n_der += 1
        
    return n_izq, n_der

from fractions import Fraction
t = int(input())
fractions = []
for  j in range(t):
    n = int(input())
    add = 0
    for i in range(2, n+1):
        n_izq, n_der = get_nums(i)
        add += Fraction(1,(n_izq*n_der))
    fractions.append(add)
    
for frac in fractions:
    print(frac)
