#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, k1, i, cost = 0;
  float t = 0;
  scanf("%d", &n);
  scanf("%d", &m);
  scanf("%d", &k);
  k1 = k;
  for (i = 0; i < n; i++) {
    if (i == k) {
      t += 0.02;
      k += k1;
    }
    cost += m - m * t;
  }
  printf("%d \n", cost);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb3(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xea3(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11fc <main+0xdc>
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    11ba <main+0x9a>
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe5c(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
movss  -0x20(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
cvtsi2ssl -0x1c(%rbp),%xmm0
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    117b <main+0x5b>
mov    -0x1c(%rbp),%esi
lea    0xe05(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%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    11ca <main+0xaa>
cvtsi2ssl 0x8(%rsp),%xmm0
mov    0x4(%rsp),%ecx
movaps 0xe94(%rip),%xmm1
xorps  %xmm0,%xmm1
xor    %esi,%esi
xorps  %xmm3,%xmm3
movsd  0xe94(%rip),%xmm2
xor    %edx,%edx
mov    %ecx,%edi
jmp    11b1 <main+0x91>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movaps %xmm1,%xmm4
mulss  %xmm3,%xmm4
addss  %xmm0,%xmm4
xorps  %xmm5,%xmm5
cvtsi2ss %esi,%xmm5
addss  %xmm4,%xmm5
cvttss2si %xmm5,%esi
add    $0x1,%edx
cmp    %edx,%eax
je     11cc <main+0xac>
cmp    %edi,%edx
jne    1190 <main+0x70>
cvtss2sd %xmm3,%xmm3
addsd  %xmm2,%xmm3
cvtsd2ss %xmm3,%xmm3
lea    (%rcx,%rdx,1),%edi
mov    %edi,0x4(%rsp)
jmp    1190 <main+0x70>
xor    %esi,%esi
lea    0xe48(%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"
@.str.1 = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
store i32 0, i32* %1
store i32 0, i32* %7
store float 0.000000e+00, float* %8
%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)
%12 = load i32, i32* %4
store i32 %12, i32* %5
store i32 0, i32* %6
br label %13
13: ; preds = %41, %0
%14 = load i32, i32* %6
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %44
17: ; preds = %13
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %29
21: ; preds = %17
%22 = load float, float* %8
%23 = fpext float %22 to double
%24 = fadd double %23, 2.000000e-02
%25 = fptrunc double %24 to float
store float %25, float* %8
%26 = load i32, i32* %5
%27 = load i32, i32* %4
%28 = add nsw i32 %27, %26
store i32 %28, i32* %4
br label %29
29: ; preds = %21, %17
%30 = load i32, i32* %3
%31 = sitofp i32 %30 to float
%32 = load i32, i32* %3
%33 = sitofp i32 %32 to float
%34 = load float, float* %8
%35 = fneg float %33
%36 = call float @llvm.fmuladd.f32(float %35, float %34, float %31)
%37 = load i32, i32* %7
%38 = sitofp i32 %37 to float
%39 = fadd float %38, %36
%40 = fptosi float %39 to i32
store i32 %40, i32* %7
br label %41
41: ; preds = %29
%42 = load i32, i32* %6
%43 = add nsw i32 %42, 1
store i32 %43, i32* %6
br label %13
44: ; preds = %13
%45 = load i32, i32* %7
%46 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %45)
%47 = load i32, i32* %1
ret i32 %47
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%d \0A\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 float [ 0.000000e+00, %13 ], [ %30, %28 ]
%19 = phi i32 [ 0, %13 ], [ %34, %28 ]
%20 = phi i32 [ 0, %13 ], [ %35, %28 ]
%21 = phi i32 [ %10, %13 ], [ %29, %28 ]
%22 = icmp eq i32 %20, %21
br i1 %22, label %23, label %28
23: ; preds = %17
%24 = fpext float %18 to double
%25 = fadd double %24, 2.000000e-02
%26 = fptrunc double %25 to float
%27 = add nsw i32 %20, %10
store i32 %27, i32* %3
br label %28
28: ; preds = %23, %17
%29 = phi i32 [ %27, %23 ], [ %21, %17 ]
%30 = phi float [ %26, %23 ], [ %18, %17 ]
%31 = call float @llvm.fmuladd.f32(float %16, float %30, float %15)
%32 = sitofp i32 %19 to float
%33 = fadd float %31, %32
%34 = fptosi float %33 to i32
%35 = add nuw nsw i32 %20, 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 ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %38)
ret i32 0
}