#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 *);
int main() {
  double res, f;
  int n, i;
  scanf("%d", &n);
  for (f = 1.0, res = 1.0, i = 1; i <= n; i++, f *= i)
    res += 1.0 / f;
  printf("%.30lf", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     11a0 <main+0x80>
movsd  0xe8c(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
cvtsi2sdl -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1160 <main+0x40>
movsd  -0x10(%rbp),%xmm0
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    114d <main+0x2d>
cmp    $0x1,%eax
jne    1157 <main+0x37>
movsd  0xeb9(%rip),%xmm1
movapd %xmm1,%xmm0
jmp    11bf <main+0x9f>
movsd  0xeab(%rip),%xmm0
jmp    11d3 <main+0xb3>
mov    %eax,%ecx
and    $0xfffffffe,%ecx
neg    %ecx
movsd  0xe9a(%rip),%xmm2
mov    $0x2,%edx
movapd %xmm2,%xmm1
movapd %xmm2,%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movapd %xmm2,%xmm3
divsd  %xmm1,%xmm3
addsd  %xmm0,%xmm3
xorps  %xmm4,%xmm4
cvtsi2sd %edx,%xmm4
mulsd  %xmm1,%xmm4
movapd %xmm2,%xmm0
divsd  %xmm4,%xmm0
addsd  %xmm3,%xmm0
lea    0x1(%rdx),%esi
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
mulsd  %xmm4,%xmm1
lea    (%rcx,%rdx,1),%esi
add    $0x2,%esi
add    $0x2,%edx
cmp    $0x2,%esi
jne    1180 <main+0x60>
test   $0x1,%al
je     11d3 <main+0xb3>
movsd  0xe35(%rip),%xmm2
divsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
lea    0xe31(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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