import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int T=input.nextInt();
int[] arr=new int[T];
double[] pi=new double[T];
for(int i=0;i<T;i++){
arr[i]=input.nextInt();
}
for(int i=0;i<T;i++){
for(int j=0;j<arr[i];j++){
if(j%2==0){
pi[i]+=1/(2*j+1);
}
if(j%2==0){
pi[i]-=1/(2*j+1);
}
}
}
for(int i=0;i<T;i++){
System.out.printf("%.4f\n",Math.floor(4*pi[i]*10000)/10000);
}
}
}
어디가 틀린건가요???