#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 *, float);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int n, k;
  float m, sum = 0, discount = 0.0;
  scanf("%d", &n);
  scanf("%f", &m);
  scanf("%d", &k);
  for (int i = 0; i < n; i += k) {
    sum += k * m * (1 - discount);
    discount += 0.02;
  }
  printf("%.f", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
lea    0xec6(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb7(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xea2(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11dd <main+0xbd>
cvtsi2ssl -0xc(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  0xe6e(%rip),%xmm2
subss  -0x18(%rbp),%xmm2
movss  -0x14(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe3e(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    117c <main+0x5c>
movss  -0x14(%rbp),%xmm0
lea    0xe29(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
lea    0xee3(%rip),%rbx
xor    %ebp,%ebp
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xece(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
test   %eax,%eax
jle    11b3 <main+0x93>
mov    0x10(%rsp),%ecx
cvtsi2ss %ecx,%xmm1
mulss  0xc(%rsp),%xmm1
xorps  %xmm4,%xmm4
movss  0xe7f(%rip),%xmm2
movsd  0xe7f(%rip),%xmm3
xorps  %xmm0,%xmm0
nopl   0x0(%rax)
movaps %xmm2,%xmm5
subss  %xmm4,%xmm5
mulss  %xmm1,%xmm5
addss  %xmm5,%xmm0
cvtss2sd %xmm4,%xmm4
addsd  %xmm3,%xmm4
cvtsd2ss %xmm4,%xmm4
add    %ecx,%ebp
cmp    %eax,%ebp
jl     1190 <main+0x70>
jmp    11b6 <main+0x96>
xorps  %xmm0,%xmm0
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

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

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