#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 pow(float, int);
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int t;
  float s, c, x;
  scanf("%d", &t);
  while (t--) {
    scanf("%f", &x);
    s = (x - (pow(x, 3)) / 6 + (pow(x, 5)) / 120 - (pow(x, 7)) / 5040 +
         (pow(x, 9)) / 362880);
    printf("%.3f\n", s);
    c = (1 - (pow(x, 2)) / 2 + (pow(x, 4)) / 24 - (pow(x, 6)) / 720 +
         (pow(x, 8)) / 40320);
    printf("%.3f\n", c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%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     12d8 <main+0x1a8>
lea    0xe97(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x14(%rbp),%xmm0
mov    $0x3,%edi
call   1050 <pow@plt>
movss  -0x30(%rbp),%xmm0
mov    $0x6,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x14(%rbp),%xmm0
mov    $0x5,%edi
call   1050 <pow@plt>
movss  -0x2c(%rbp),%xmm0
mov    $0x78,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x14(%rbp),%xmm0
mov    $0x7,%edi
call   1050 <pow@plt>
movss  -0x28(%rbp),%xmm0
mov    $0x13b0,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x14(%rbp),%xmm0
mov    $0x9,%edi
call   1050 <pow@plt>
movss  -0x24(%rbp),%xmm0
mov    $0x58980,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xdd5(%rip),%rdi
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
mov    %eax,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
mov    $0x4,%edi
call   1050 <pow@plt>
mov    $0x18,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
mov    $0x6,%edi
call   1050 <pow@plt>
mov    $0x2d0,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
mov    $0x8,%edi
call   1050 <pow@plt>
mov    $0x9d80,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
lea    0xd38(%rip),%rdi
call   1030 <printf@plt>
jmp    1151 <main+0x21>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xebc(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subl   $0x1,0xc(%rsp)
jb     1335 <main+0x205>
lea    0xea1(%rip),%r14
lea    0x4(%rsp),%r15
lea    0xe98(%rip),%r12
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
mov    $0x3,%edi
call   1050 <pow@plt>
cltq
imul   $0x2aaaaaab,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  0x8(%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0x8(%rsp)
movss  0x4(%rsp),%xmm0
mov    $0x5,%edi
call   1050 <pow@plt>
cltq
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x6,%eax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
addss  0x8(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
movss  0x4(%rsp),%xmm0
mov    $0x7,%edi
call   1050 <pow@plt>
cltq
imul   $0xffffffffd00d00d1,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0xc,%eax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  0x8(%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0x8(%rsp)
movss  0x4(%rsp),%xmm0
mov    $0x9,%edi
call   1050 <pow@plt>
cltq
imul   $0x2e3bc74b,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
sar    $0x10,%eax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
addss  0x8(%rsp),%xmm0
mov    %r12,%rdi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
movss  0x4(%rsp),%xmm0
mov    $0x4,%edi
call   1050 <pow@plt>
cltq
imul   $0x2aaaaaab,%rax,%r13
mov    %r13,%rax
shr    $0x3f,%rax
shr    $0x20,%r13
sar    $0x2,%r13d
add    %eax,%r13d
sub    %ebx,%r13d
movss  0x4(%rsp),%xmm0
mov    $0x6,%edi
call   1050 <pow@plt>
cltq
imul   $0x49f49f49,%rax,%rbx
shr    $0x20,%rbx
sub    %eax,%ebx
mov    %ebx,%eax
shr    $0x1f,%eax
sar    $0x9,%ebx
add    %eax,%ebx
add    %r13d,%ebx
movss  0x4(%rsp),%xmm0
mov    $0x8,%edi
call   1050 <pow@plt>
cltq
imul   $0xffffffffd00d00d1,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0xf,%eax
add    %ecx,%eax
add    %ebx,%eax
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mov    %r12,%rdi
call   1030 <printf@plt>
subl   $0x1,0xc(%rsp)
jae    1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [6 x i8] c"%.3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %7
7: ; preds = %11, %0
%8 = load i32, i32* %2
%9 = add nsw i32 %8, -1
store i32 %9, i32* %2
%10 = icmp ne i32 %8, 0
br i1 %10, label %11, label %55
11: ; preds = %7
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %5)
%13 = load float, float* %5
%14 = load float, float* %5
%15 = call i32 @pow(float %14, i32 3)
%16 = sdiv i32 %15, 6
%17 = sitofp i32 %16 to float
%18 = fsub float %13, %17
%19 = load float, float* %5
%20 = call i32 @pow(float %19, i32 5)
%21 = sdiv i32 %20, 120
%22 = sitofp i32 %21 to float
%23 = fadd float %18, %22
%24 = load float, float* %5
%25 = call i32 @pow(float %24, i32 7)
%26 = sdiv i32 %25, 5040
%27 = sitofp i32 %26 to float
%28 = fsub float %23, %27
%29 = load float, float* %5
%30 = call i32 @pow(float %29, i32 9)
%31 = sdiv i32 %30, 362880
%32 = sitofp i32 %31 to float
%33 = fadd float %28, %32
store float %33, float* %3
%34 = load float, float* %3
%35 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), float %34)
%36 = load float, float* %5
%37 = call i32 @pow(float %36, i32 2)
%38 = sdiv i32 %37, 2
%39 = sub nsw i32 1, %38
%40 = load float, float* %5
%41 = call i32 @pow(float %40, i32 4)
%42 = sdiv i32 %41, 24
%43 = add nsw i32 %39, %42
%44 = load float, float* %5
%45 = call i32 @pow(float %44, i32 6)
%46 = sdiv i32 %45, 720
%47 = sub nsw i32 %43, %46
%48 = load float, float* %5
%49 = call i32 @pow(float %48, i32 8)
%50 = sdiv i32 %49, 40320
%51 = add nsw i32 %47, %50
%52 = sitofp i32 %51 to float
store float %52, float* %4
%53 = load float, float* %4
%54 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), float %53)
br label %7
55: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [6 x i8] c"%.3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = bitcast i32* %1 to i8*
%4 = bitcast float* %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 %53, label %9
9: ; preds = %0, %9
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%11 = load float, float* %2
%12 = call i32 @pow(float %11, i32 3)
%13 = sdiv i32 %12, 6
%14 = sitofp i32 %13 to float
%15 = fsub float %11, %14
%16 = load float, float* %2
%17 = call i32 @pow(float %16, i32 5)
%18 = sdiv i32 %17, 120
%19 = sitofp i32 %18 to float
%20 = fadd float %15, %19
%21 = load float, float* %2
%22 = call i32 @pow(float %21, i32 7)
%23 = sdiv i32 %22, 5040
%24 = sitofp i32 %23 to float
%25 = fsub float %20, %24
%26 = load float, float* %2
%27 = call i32 @pow(float %26, i32 9)
%28 = sdiv i32 %27, 362880
%29 = sitofp i32 %28 to float
%30 = fadd float %25, %29
%31 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), float %30)
%32 = load float, float* %2
%33 = call i32 @pow(float %32, i32 2)
%34 = sdiv i32 %33, -2
%35 = add nsw i32 %34, 1
%36 = load float, float* %2
%37 = call i32 @pow(float %36, i32 4)
%38 = sdiv i32 %37, 24
%39 = add nsw i32 %35, %38
%40 = load float, float* %2
%41 = call i32 @pow(float %40, i32 6)
%42 = sdiv i32 %41, -720
%43 = add nsw i32 %39, %42
%44 = load float, float* %2
%45 = call i32 @pow(float %44, i32 8)
%46 = sdiv i32 %45, 40320
%47 = add nsw i32 %43, %46
%48 = sitofp i32 %47 to float
%49 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), float %48)
%50 = load i32, i32* %1
%51 = add nsw i32 %50, -1
store i32 %51, i32* %1
%52 = icmp eq i32 %50, 0
br i1 %52, label %53, label %9
53: ; preds = %9, %0
ret i32 0
}