#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int t;
  double n, ans;
  scanf("%d", &t);
  while (t--) {
    scanf("%lf", &n);
    ans = 0.5 * (0.5 - (1.0 / ((n + 1.0) * (n + 2.0)))) - (1.0 / 6.0) +
          (2.0 / 3.0);
    printf("%.11lf\n", ans);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xef2(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     11dc <main+0xbc>
lea    0xecf(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsd  0xea9(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xea4(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe8b(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0xe6f(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  0xe63(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe5f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe43(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
jmp    1141 <main+0x21>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xef8(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subl   $0x1,0x4(%rsp)
jb     11ca <main+0xaa>
lea    0xedd(%rip),%r14
lea    0x8(%rsp),%r15
lea    0xed5(%rip),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
movapd %xmm0,%xmm1
movsd  0xe81(%rip),%xmm2
addsd  %xmm2,%xmm1
addsd  0xe7d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm2,%xmm1
divsd  %xmm0,%xmm1
movsd  0xe71(%rip),%xmm2
movapd %xmm2,%xmm0
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
addsd  0xe65(%rip),%xmm0
addsd  0xe65(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
subl   $0x1,0x4(%rsp)
jae    1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [8 x i8] c"%.11lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %6
6: ; preds = %10, %0
%7 = load i32, i32* %2
%8 = add nsw i32 %7, -1
store i32 %8, i32* %2
%9 = icmp ne i32 %7, 0
br i1 %9, label %10, label %23
10: ; preds = %6
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
%12 = load double, double* %3
%13 = fadd double %12, 1.000000e+00
%14 = load double, double* %3
%15 = fadd double %14, 2.000000e+00
%16 = fmul double %13, %15
%17 = fdiv double 1.000000e+00, %16
%18 = fsub double 5.000000e-01, %17
%19 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %18, double 0xBFC5555555555555)
%20 = fadd double %19, 0x3FE5555555555555
store double %20, double* %4
%21 = load double, double* %4
%22 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %21)
br label %6
23: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [8 x i8] c"%.11lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = bitcast i32* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = add nsw i32 %6, -1
store i32 %7, i32* %1
%8 = icmp eq i32 %6, 0
br i1 %8, label %23, label %9
9: ; preds = %0, %9
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%11 = load double, double* %2
%12 = fadd double %11, 1.000000e+00
%13 = fadd double %11, 2.000000e+00
%14 = fmul double %12, %13
%15 = fdiv double 1.000000e+00, %14
%16 = fsub double 5.000000e-01, %15
%17 = call double @llvm.fmuladd.f64(double %16, double 5.000000e-01, double 0xBFC5555555555555)
%18 = fadd double %17, 0x3FE5555555555555
%19 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %18)
%20 = load i32, i32* %1
%21 = add nsw i32 %20, -1
store i32 %21, i32* %1
%22 = icmp eq i32 %20, 0
br i1 %22, label %23, label %9
23: ; preds = %9, %0
ret i32 0
}