#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 *, float *);
int main() {
  float n, m, k, result, count, t;
  scanf("%f", &n);
  scanf("%f", &m);
  scanf("%f", &k);
  count = 0;
  result = 0;
  t = m * 0.02;
  while (n > 0) {
    if (count == k) {
      m = m - t;
      count = 0;
    }
    result = result + m;
    n--;
    count++;
  }
  printf("%.f", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeca(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe80(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1202 <main+0xe2>
movss  -0x18(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jne    11ca <main+0xaa>
jp     11ca <main+0xaa>
movss  -0xc(%rbp),%xmm0
subss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe2b(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xe15(%rip),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    118d <main+0x6d>
movss  -0x14(%rbp),%xmm0
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    0xee4(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0x8(%rsp),%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jbe    11ce <main+0xae>
movss  0x4(%rsp),%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
mulsd  0xe8a(%rip),%xmm0
cvtsd2ss %xmm0,%xmm3
xorps  %xmm8,%xmm8
movss  0xc(%rsp),%xmm5
movss  0xe7c(%rip),%xmm6
movss  0xe78(%rip),%xmm7
xorps  %xmm0,%xmm0
xorps  %xmm4,%xmm4
jmp    11b2 <main+0x92>
nopl   0x0(%rax)
addss  %xmm2,%xmm0
addss  %xmm6,%xmm1
addss  %xmm7,%xmm4
ucomiss %xmm8,%xmm1
jbe    11c8 <main+0xa8>
ucomiss %xmm5,%xmm4
jne    11a0 <main+0x80>
jp     11a0 <main+0x80>
subss  %xmm3,%xmm2
movss  %xmm2,0x4(%rsp)
xorps  %xmm4,%xmm4
jmp    11a0 <main+0x80>
movss  %xmm1,0x8(%rsp)
lea    0xe3e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

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