#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 */
scalar_t__ EOF;
double pow(double, int);
int /*<<< orphan*/ printf(char *, double);
scalar_t__ scanf(char *, int *);
int main() {
  int m, n, i, u;
  double S;
  while (scanf("%d", &m) != EOF) {
    for (i = 1; i <= m; i++) {
      scanf("%d", &n);
      S = 0.0;
      for (u = 1; u <= n; u++)
        S += (1.0 / u) * pow(-1.0, (u + 1));
      printf("%.2lf\n", S);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e92(%rip),%rcx
cmp    (%rcx),%rax
je     1212 <main+0xe2>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     120d <main+0xdd>
lea    0xe97(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11ee <main+0xbe>
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xe5e(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
movsd  0xe3f(%rip),%xmm0
call   1050 <pow@plt>
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1191 <main+0x61>
movsd  -0x20(%rbp),%xmm0
lea    0xe19(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1166 <main+0x36>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecb(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    0x2e94(%rip),%rcx
cmp    (%rcx),%rax
jne    116a <main+0x3a>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe9f(%rip),%rbx
lea    0x4(%rsp),%r15
lea    0xe96(%rip),%r12
jmp    1197 <main+0x67>
nop
mov    %rbx,%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    0x2e56(%rip),%rcx
cmp    (%rcx),%rax
je     1159 <main+0x29>
cmpl   $0x0,(%rsp)
jle    1180 <main+0x50>
mov    $0x1,%r14d
jmp    11cd <main+0x9d>
cs nopw 0x0(%rax,%rax,1)
nop
xorpd  %xmm1,%xmm1
mov    %r12,%rdi
movapd %xmm1,%xmm0
call   1030 <printf@plt>
lea    0x1(%r14),%eax
cmp    (%rsp),%r14d
mov    %eax,%r14d
jge    1180 <main+0x50>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    11b0 <main+0x80>
mov    $0x1,%r13d
xorps  %xmm1,%xmm1
nopl   0x0(%rax,%rax,1)
movsd  %xmm1,0x10(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
movsd  0xdfa(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
lea    0x1(%r13),%ebp
movsd  0xdec(%rip),%xmm0
mov    %ebp,%edi
call   1050 <pow@plt>
movsd  0x10(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm1
cmp    0x4(%rsp),%r13d
mov    %ebp,%r13d
jl     11f0 <main+0xc0>
jmp    11b4 <main+0x84>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32 0, i32* %1
br label %7
7: ; preds = %40, %0
%8 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = load i64, i64* @EOF
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %41
11: ; preds = %7
store i32 1, i32* %4
br label %12
12: ; preds = %37, %11
%13 = load i32, i32* %4
%14 = load i32, i32* %2
%15 = icmp sle i32 %13, %14
br i1 %15, label %16, label %40
16: ; preds = %12
%17 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
store double 0.000000e+00, double* %6
store i32 1, i32* %5
br label %18
18: ; preds = %31, %16
%19 = load i32, i32* %5
%20 = load i32, i32* %3
%21 = icmp sle i32 %19, %20
br i1 %21, label %22, label %34
22: ; preds = %18
%23 = load i32, i32* %5
%24 = sitofp i32 %23 to double
%25 = fdiv double 1.000000e+00, %24
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
%28 = call double @pow(double -1.000000e+00, i32 %27)
%29 = load double, double* %6
%30 = call double @llvm.fmuladd.f64(double %25, double %28, double %29)
store double %30, double* %6
br label %31
31: ; preds = %22
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
br label %18
34: ; preds = %18
%35 = load double, double* %6
%36 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %35)
br label %37
37: ; preds = %34
%38 = load i32, i32* %4
%39 = add nsw i32 %38, 1
store i32 %39, i32* %4
br label %12
40: ; preds = %12
br label %7
41: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %36, label %12
8: ; preds = %30, %12
%9 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = load i64, i64* @EOF
%11 = icmp eq i64 %9, %10
br i1 %11, label %36, label %12
12: ; preds = %0, %8
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 1
br i1 %14, label %8, label %15
15: ; preds = %12, %30
%16 = phi i32 [ %33, %30 ], [ 1, %12 ]
%17 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%18 = load i32, i32* %2
%19 = icmp slt i32 %18, 1
br i1 %19, label %30, label %20
20: ; preds = %15, %20
%21 = phi double [ %27, %20 ], [ 0.000000e+00, %15 ]
%22 = phi i32 [ %25, %20 ], [ 1, %15 ]
%23 = sitofp i32 %22 to double
%24 = fdiv double 1.000000e+00, %23
%25 = add nuw nsw i32 %22, 1
%26 = call double @pow(double -1.000000e+00, i32 %25)
%27 = call double @llvm.fmuladd.f64(double %24, double %26, double %21)
%28 = load i32, i32* %2
%29 = icmp slt i32 %22, %28
br i1 %29, label %20, label %30
30: ; preds = %20, %15
%31 = phi double [ 0.000000e+00, %15 ], [ %27, %20 ]
%32 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %31)
%33 = add nuw nsw i32 %16, 1
%34 = load i32, i32* %1
%35 = icmp slt i32 %16, %34
br i1 %35, label %15, label %8
36: ; preds = %8, %0
ret i32 0
}