#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 *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n, debt = 100000, i;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    debt *= 1.05;
    if (debt % 1000 != 0) {
      debt = ((debt / 1000) + 1) * 1000;
    }
  }
  printf("%d\n", debt);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x186a0,-0xc(%rbp)
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11af <main+0x8f>
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xe9a(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     119c <main+0x7c>
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
imul   $0x3e8,%eax,%eax
mov    %eax,-0xc(%rbp)
jmp    11a1 <main+0x81>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114d <main+0x2d>
mov    -0xc(%rbp),%esi
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%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    1151 <main+0x31>
cmp    $0x1,%eax
jne    115b <main+0x3b>
mov    $0x19a28,%ecx
test   $0x1,%al
jne    11fa <main+0xda>
jmp    1222 <main+0x102>
mov    $0x186a0,%esi
jmp    1222 <main+0x102>
mov    %eax,%ecx
and    $0xfffffffe,%ecx
mov    $0x186a0,%esi
movsd  0xe93(%rip),%xmm0
nopl   (%rax)
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edx
movslq %edx,%rdx
imul   $0x10624dd3,%rdx,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x26,%rsi
add    %edi,%esi
imul   $0x3e8,%esi,%esi
lea    0x3e8(%rsi),%edi
cmp    %esi,%edx
cmove  %edx,%edi
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edx
movslq %edx,%rdx
imul   $0x10624dd3,%rdx,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x26,%rsi
add    %edi,%esi
imul   $0x3e8,%esi,%edi
lea    0x3e8(%rdi),%esi
cmp    %edi,%edx
cmove  %edx,%esi
add    $0xfffffffe,%ecx
jne    1170 <main+0x50>
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
mulsd  0xe0e(%rip),%xmm0
cvttsd2si %xmm0,%ecx
test   $0x1,%al
je     1222 <main+0x102>
movslq %ecx,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
lea    0x3e8(%rcx),%esi
cmp    %ecx,%eax
cmove  %eax,%esi
lea    0xde2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 100000, i32* %3
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %4
br label %6
6: ; preds = %24, %0
%7 = load i32, i32* %4
%8 = load i32, i32* %2
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %27
10: ; preds = %6
%11 = load i32, i32* %3
%12 = sitofp i32 %11 to double
%13 = fmul double %12, 1.050000e+00
%14 = fptosi double %13 to i32
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = srem i32 %15, 1000
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %10
%19 = load i32, i32* %3
%20 = sdiv i32 %19, 1000
%21 = add nsw i32 %20, 1
%22 = mul nsw i32 %21, 1000
store i32 %22, i32* %3
br label %23
23: ; preds = %18, %10
br label %24
24: ; preds = %23
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %6
27: ; preds = %6
%28 = load i32, i32* %3
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %28)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\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 sgt i32 %4, 0
br i1 %5, label %6, label %46
6: ; preds = %0
%7 = and i32 %4, 1
%8 = icmp eq i32 %4, 1
br i1 %8, label %36, label %9
9: ; preds = %6
%10 = and i32 %4, -2
br label %11
11: ; preds = %11, %9
%12 = phi i32 [ 100000, %9 ], [ %29, %11 ]
%13 = phi i32 [ 0, %9 ], [ %30, %11 ]
%14 = sitofp i32 %12 to double
%15 = fmul double %14, 1.050000e+00
%16 = fptosi double %15 to i32
%17 = srem i32 %16, 1000
%18 = icmp eq i32 %17, 0
%19 = add i32 %16, 1000
%20 = sub i32 %19, %17
%21 = select i1 %18, i32 %16, i32 %20
%22 = sitofp i32 %21 to double
%23 = fmul double %22, 1.050000e+00
%24 = fptosi double %23 to i32
%25 = srem i32 %24, 1000
%26 = icmp eq i32 %25, 0
%27 = add i32 %24, 1000
%28 = sub i32 %27, %25
%29 = select i1 %26, i32 %24, i32 %28
%30 = add i32 %13, 2
%31 = icmp eq i32 %30, %10
br i1 %31, label %32, label %11
32: ; preds = %11
%33 = sitofp i32 %29 to double
%34 = fmul double %33, 1.050000e+00
%35 = fptosi double %34 to i32
br label %36
36: ; preds = %32, %6
%37 = phi i32 [ undef, %6 ], [ %29, %32 ]
%38 = phi i32 [ 105000, %6 ], [ %35, %32 ]
%39 = icmp eq i32 %7, 0
br i1 %39, label %46, label %40
40: ; preds = %36
%41 = srem i32 %38, 1000
%42 = icmp eq i32 %41, 0
%43 = add i32 %38, 1000
%44 = sub i32 %43, %41
%45 = select i1 %42, i32 %38, i32 %44
br label %46
46: ; preds = %40, %36, %0
%47 = phi i32 [ 100000, %0 ], [ %37, %36 ], [ %45, %40 ]
%48 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %47)
ret i32 0
}