#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, k, m, s;
  float x;
  do {
    scanf("%d", &n);
    scanf("%d", &m);
    scanf("%d", &k);
  } while (n <= 0 || m < 0);
  s = 0;
  x = 0;
  do {
    s = s + k * (m - x);
    x = x + 2 * m / 100;
    n = n - k;
  } while (n > 0);
  printf("\n%d", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xebb(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeab(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x19(%rbp)
jle    1178 <main+0x58>
cmpl   $0x0,-0x10(%rbp)
setl   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    112f <main+0xf>
movl   $0x0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
cvtsi2ssl -0x14(%rbp),%xmm1
cvtsi2ssl -0xc(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm2
subss  -0x18(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
movss  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1192 <main+0x72>
mov    -0x14(%rbp),%esi
lea    0xe0e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecf(%rip),%rbx
lea    0xc(%rsp),%r14
lea    0x10(%rsp),%r15
lea    0x14(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    1150 <main+0x30>
mov    0x10(%rsp),%edx
test   %edx,%edx
js     1150 <main+0x30>
mov    0x14(%rsp),%ecx
cvtsi2ss %ecx,%xmm0
cvtsi2ss %edx,%xmm1
mov    %edx,%edx
imul   $0x51eb851f,%rdx,%rdx
shr    $0x24,%rdx
cvtsi2ss %edx,%xmm2
xorps  %xmm3,%xmm3
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xorps  %xmm4,%xmm4
cvtsi2ss %esi,%xmm4
movaps %xmm1,%xmm5
subss  %xmm3,%xmm5
mulss  %xmm0,%xmm5
addss  %xmm4,%xmm5
cvttss2si %xmm5,%esi
addss  %xmm2,%xmm3
sub    %ecx,%eax
test   %eax,%eax
jg     11b0 <main+0x90>
mov    %eax,0xc(%rsp)
lea    0xe21(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 0, i32* %1
br label %7
7: ; preds = %17, %0
%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* %4)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
br label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 0
br label %17
17: ; preds = %14, %11
%18 = phi i1 [ true, %11 ], [ %16, %14 ]
br i1 %18, label %7, label %19
19: ; preds = %17
store i32 0, i32* %5
store float 0.000000e+00, float* %6
br label %20
20: ; preds = %40, %19
%21 = load i32, i32* %5
%22 = sitofp i32 %21 to float
%23 = load i32, i32* %3
%24 = sitofp i32 %23 to float
%25 = load i32, i32* %4
%26 = sitofp i32 %25 to float
%27 = load float, float* %6
%28 = fsub float %26, %27
%29 = call float @llvm.fmuladd.f32(float %24, float %28, float %22)
%30 = fptosi float %29 to i32
store i32 %30, i32* %5
%31 = load float, float* %6
%32 = load i32, i32* %4
%33 = mul nsw i32 2, %32
%34 = sdiv i32 %33, 100
%35 = sitofp i32 %34 to float
%36 = fadd float %31, %35
store float %36, float* %6
%37 = load i32, i32* %2
%38 = load i32, i32* %3
%39 = sub nsw i32 %37, %38
store i32 %39, i32* %2
br label %40
40: ; preds = %20
%41 = load i32, i32* %2
%42 = icmp sgt i32 %41, 0
br i1 %42, label %20, label %43
43: ; preds = %40
%44 = load i32, i32* %5
%45 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %44)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"\0A%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*
br label %7
7: ; preds = %7, %0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %1
%12 = icmp slt i32 %11, 1
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 0
%15 = select i1 %12, i1 true, i1 %14
br i1 %15, label %7, label %16
16: ; preds = %7
%17 = load i32, i32* %2
%18 = sitofp i32 %17 to float
%19 = sitofp i32 %13 to float
%20 = udiv i32 %13, 50
%21 = sitofp i32 %20 to float
br label %22
22: ; preds = %16, %22
%23 = phi i32 [ %31, %22 ], [ %11, %16 ]
%24 = phi i32 [ %29, %22 ], [ 0, %16 ]
%25 = phi float [ %30, %22 ], [ 0.000000e+00, %16 ]
%26 = sitofp i32 %24 to float
%27 = fsub float %19, %25
%28 = call float @llvm.fmuladd.f32(float %18, float %27, float %26)
%29 = fptosi float %28 to i32
%30 = fadd float %25, %21
%31 = sub nsw i32 %23, %17
%32 = icmp sgt i32 %31, 0
br i1 %32, label %22, label %33
33: ; preds = %22
store i32 %31, i32* %1
%34 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %29)
ret i32 0
}