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


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