#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() {
  int n, m, k, j, sum = 0;
  scanf("%d", &n);
  scanf("%d", &m);
  scanf("%d", &k);
  float pers = 0;
  int i = k;
  for (j = 0; j < n; j++) {
    if (j == k) {
      k = k + i;
      pers = pers + 0.02;
    }
    sum = sum + m - m * pers;
  }
  printf("%d", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xebb(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeab(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11f8 <main+0xd8>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    11ba <main+0x9a>
mov    -0x10(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x10(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe53(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm1
cvtsi2ssl -0xc(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    117b <main+0x5b>
mov    -0x18(%rbp),%esi
lea    0xe06(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeec(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    11c8 <main+0xa8>
mov    0x8(%rsp),%ecx
cvtsi2ss %ecx,%xmm0
mov    0x4(%rsp),%edx
xorps  0xe92(%rip),%xmm0
xorps  %xmm2,%xmm2
xor    %edi,%edi
movsd  0xe95(%rip),%xmm1
xor    %esi,%esi
mov    %edx,%ebx
jmp    11af <main+0x8f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    %ecx,%esi
xorps  %xmm3,%xmm3
cvtsi2ss %esi,%xmm3
movaps %xmm0,%xmm4
mulss  %xmm2,%xmm4
addss  %xmm3,%xmm4
cvttss2si %xmm4,%esi
add    $0x1,%edi
cmp    %edi,%eax
je     11ca <main+0xaa>
cmp    %ebx,%edi
jne    1190 <main+0x70>
lea    (%rdx,%rdi,1),%ebx
mov    %ebx,0x4(%rsp)
cvtss2sd %xmm2,%xmm2
addsd  %xmm1,%xmm2
cvtsd2ss %xmm2,%xmm2
jmp    1190 <main+0x70>
xor    %esi,%esi
lea    0xe47(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %6
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
store float 0.000000e+00, float* %7
%12 = load i32, i32* %4
store i32 %12, i32* %8
store i32 0, i32* %5
br label %13
13: ; preds = %40, %0
%14 = load i32, i32* %5
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %43
17: ; preds = %13
%18 = load i32, i32* %5
%19 = load i32, i32* %4
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %29
21: ; preds = %17
%22 = load i32, i32* %4
%23 = load i32, i32* %8
%24 = add nsw i32 %22, %23
store i32 %24, i32* %4
%25 = load float, float* %7
%26 = fpext float %25 to double
%27 = fadd double %26, 2.000000e-02
%28 = fptrunc double %27 to float
store float %28, float* %7
br label %29
29: ; preds = %21, %17
%30 = load i32, i32* %6
%31 = load i32, i32* %3
%32 = add nsw i32 %30, %31
%33 = sitofp i32 %32 to float
%34 = load i32, i32* %3
%35 = sitofp i32 %34 to float
%36 = load float, float* %7
%37 = fneg float %35
%38 = call float @llvm.fmuladd.f32(float %37, float %36, float %33)
%39 = fptosi float %38 to i32
store i32 %39, i32* %6
br label %40
40: ; preds = %29
%41 = load i32, i32* %5
%42 = add nsw i32 %41, 1
store i32 %42, i32* %5
br label %13
43: ; preds = %13
%44 = load i32, i32* %6
%45 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %44)
ret i32 0
}

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