#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, money, i, sum = 0;
  int p = 0;
  scanf("%d", &n);
  scanf("%d", &m);
  scanf("%d", &k);
  money = m;
  while (n > 0) {
    for (i = k; i > 0; i--) {
      sum += money;
    }
    p += 2;
    money = m - (m * p / 100);
    n -= k;
  }
  printf("%d", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeac(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe9c(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    11dc <main+0xbc>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    11a4 <main+0x84>
mov    -0x14(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1183 <main+0x63>
mov    -0x20(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x20(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    1173 <main+0x53>
mov    -0x1c(%rbp),%esi
lea    0xe1a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    11b4 <main+0x94>
mov    0xc(%rsp),%r9d
mov    0x8(%rsp),%edx
lea    (%r9,%r9,1),%r10d
xor    %r8d,%r8d
mov    %r10d,%ebx
xor    %esi,%esi
mov    %r9d,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
imul   %edx,%ecx
test   %edx,%edx
cmovle %r8d,%ecx
add    %ecx,%esi
movslq %ebx,%rbx
imul   $0xffffffffae147ae1,%rbx,%rcx
mov    %rcx,%rdi
shr    $0x3f,%rdi
sar    $0x25,%rcx
add    %edi,%ecx
add    %r9d,%ecx
sub    %edx,%eax
add    %r10d,%ebx
test   %eax,%eax
jg     1180 <main+0x60>
mov    %eax,0x4(%rsp)
jmp    11b6 <main+0x96>
xor    %esi,%esi
lea    0xe43(%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"
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 i32
store i32 0, i32* %1
store i32 0, i32* %7
store i32 0, i32* %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* %3
store i32 %12, i32* %5
br label %13
13: ; preds = %28, %0
%14 = load i32, i32* %2
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %40
16: ; preds = %13
%17 = load i32, i32* %4
store i32 %17, i32* %6
br label %18
18: ; preds = %25, %16
%19 = load i32, i32* %6
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %28
21: ; preds = %18
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = add nsw i32 %23, %22
store i32 %24, i32* %7
br label %25
25: ; preds = %21
%26 = load i32, i32* %6
%27 = add nsw i32 %26, -1
store i32 %27, i32* %6
br label %18
28: ; preds = %18
%29 = load i32, i32* %8
%30 = add nsw i32 %29, 2
store i32 %30, i32* %8
%31 = load i32, i32* %3
%32 = load i32, i32* %3
%33 = load i32, i32* %8
%34 = mul nsw i32 %32, %33
%35 = sdiv i32 %34, 100
%36 = sub nsw i32 %31, %35
store i32 %36, i32* %5
%37 = load i32, i32* %4
%38 = load i32, i32* %2
%39 = sub nsw i32 %38, %37
store i32 %39, i32* %2
br label %13
40: ; preds = %13
%41 = load i32, i32* %7
%42 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %41)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%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*
%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* %2
%11 = load i32, i32* %1
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %31
13: ; preds = %0
%14 = load i32, i32* %3
%15 = icmp sgt i32 %14, 0
br label %16
16: ; preds = %13, %16
%17 = phi i32 [ 0, %13 ], [ %24, %16 ]
%18 = phi i32 [ 0, %13 ], [ %23, %16 ]
%19 = phi i32 [ %10, %13 ], [ %27, %16 ]
%20 = phi i32 [ %11, %13 ], [ %28, %16 ]
%21 = mul i32 %14, %19
%22 = select i1 %15, i32 %21, i32 0
%23 = add i32 %18, %22
%24 = add nuw nsw i32 %17, 2
%25 = mul nsw i32 %24, %10
%26 = sdiv i32 %25, -100
%27 = add i32 %26, %10
%28 = sub nsw i32 %20, %14
%29 = icmp sgt i32 %28, 0
br i1 %29, label %16, label %30
30: ; preds = %16
store i32 %28, i32* %1
br label %31
31: ; preds = %30, %0
%32 = phi i32 [ %23, %30 ], [ 0, %0 ]
%33 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %32)
ret i32 0
}