#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, sum, poreden, pr;
  scanf("%d", &n);
  scanf("%d", &m);
  scanf("%d", &k);
  poreden = 0;
  pr = 0;
  sum = m;
  do {
    poreden++;
    if (poreden % k == 0)
      pr = pr + 2;
    sum = sum + m - (m * pr / 100);
    n--;
  } while (n > 1);
  printf("%d", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeaa(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    1195 <main+0x75>
mov    -0x1c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x1c(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1173 <main+0x53>
mov    -0x14(%rbp),%esi
lea    0xe2c(%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    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    0xc(%rsp),%edi
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
mov    $0x2,%r8d
cmovl  %eax,%r8d
mov    0x8(%rsp),%r9d
mov    %r8d,%r10d
sub    %eax,%r10d
xor    %ebx,%ebx
mov    $0x1,%ecx
mov    %edi,%esi
nopl   0x0(%rax)
mov    %ecx,%eax
cltd
idiv   %r9d
lea    0x2(%rbx),%eax
test   %edx,%edx
cmovne %ebx,%eax
mov    %esi,%edx
add    %edi,%edx
mov    %eax,%ebx
imul   %edi,%eax
cltq
imul   $0xffffffffae147ae1,%rax,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x25,%rsi
add    %eax,%esi
add    %edx,%esi
lea    (%r10,%rcx,1),%eax
add    $0x1,%eax
add    $0x1,%ecx
cmp    $0x2,%eax
jne    1180 <main+0x60>
add    $0xffffffff,%r8d
mov    %r8d,0x4(%rsp)
lea    0xe32(%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
store i32 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 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
store i32 0, i32* %6
store i32 0, i32* %7
%11 = load i32, i32* %3
store i32 %11, i32* %5
br label %12
12: ; preds = %33, %0
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = load i32, i32* %4
%17 = srem i32 %15, %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %12
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 2
store i32 %21, i32* %7
br label %22
22: ; preds = %19, %12
%23 = load i32, i32* %5
%24 = load i32, i32* %3
%25 = add nsw i32 %23, %24
%26 = load i32, i32* %3
%27 = load i32, i32* %7
%28 = mul nsw i32 %26, %27
%29 = sdiv i32 %28, 100
%30 = sub nsw i32 %25, %29
store i32 %30, i32* %5
%31 = load i32, i32* %2
%32 = add nsw i32 %31, -1
store i32 %32, i32* %2
br label %33
33: ; preds = %22
%34 = load i32, i32* %2
%35 = icmp sgt i32 %34, 1
br i1 %35, label %12, label %36
36: ; preds = %33
%37 = load i32, i32* %5
%38 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %37)
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* %3
%12 = load i32, i32* %1
%13 = call i32 @llvm.smin.i32(i32 %12, i32 2)
%14 = add i32 %12, 1
%15 = sub i32 %14, %13
br label %16
16: ; preds = %16, %0
%17 = phi i32 [ %10, %0 ], [ %28, %16 ]
%18 = phi i32 [ 0, %0 ], [ %20, %16 ]
%19 = phi i32 [ 0, %0 ], [ %24, %16 ]
%20 = add nuw nsw i32 %18, 1
%21 = srem i32 %20, %11
%22 = icmp eq i32 %21, 0
%23 = add nsw i32 %19, 2
%24 = select i1 %22, i32 %23, i32 %19
%25 = add nsw i32 %17, %10
%26 = mul nsw i32 %24, %10
%27 = sdiv i32 %26, -100
%28 = add i32 %25, %27
%29 = icmp eq i32 %20, %15
br i1 %29, label %30, label %16
30: ; preds = %16
%31 = add i32 %13, -1
store i32 %31, i32* %1
%32 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %28)
ret i32 0
}