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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x2,-0x20(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeac(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe9c(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11df <main+0xbf>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    11c8 <main+0xa8>
cmpl   $0x0,-0x8(%rbp)
jle    11c8 <main+0xa8>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x20(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117a <main+0x5a>
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    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>
mov    0x8(%rsp),%r8d
test   %r8d,%r8d
jle    11bc <main+0x9c>
mov    0x4(%rsp),%r9d
xor    %esi,%esi
mov    $0x2,%edi
mov    0xc(%rsp),%r10d
mov    %r9d,%ebx
xor    %ecx,%ecx
jmp    118a <main+0x6a>
cs nopw 0x0(%rax,%rax,1)
nop
add    %ebx,%esi
add    $0x1,%ecx
cmp    %ecx,%r8d
je     11be <main+0x9e>
mov    %ecx,%eax
cltd
idiv   %r10d
test   %ecx,%ecx
je     1180 <main+0x60>
test   %edx,%edx
jne    1180 <main+0x60>
mov    %edi,%eax
imul   %r9d,%eax
cltq
imul   $0xffffffffae147ae1,%rax,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x25,%rbx
add    %eax,%ebx
add    %r9d,%ebx
add    $0x2,%edi
jmp    1180 <main+0x60>
xor    %esi,%esi
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"%d\00"
@.str.1 = [4 x i8] c"%d\0A\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 2, i32* %8
%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* %5)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%12 = load i32, i32* %5
store i32 %12, i32* %6
store i32 0, i32* %2
br label %13
13: ; preds = %38, %0
%14 = load i32, i32* %2
%15 = load i32, i32* %4
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %41
17: ; preds = %13
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = srem i32 %18, %19
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %34
22: ; preds = %17
%23 = load i32, i32* %2
%24 = icmp sgt i32 %23, 0
br i1 %24, label %25, label %34
25: ; preds = %22
%26 = load i32, i32* %5
%27 = load i32, i32* %5
%28 = load i32, i32* %8
%29 = mul nsw i32 %27, %28
%30 = sdiv i32 %29, 100
%31 = sub nsw i32 %26, %30
store i32 %31, i32* %6
%32 = load i32, i32* %8
%33 = add nsw i32 %32, 2
store i32 %33, i32* %8
br label %34
34: ; preds = %25, %22, %17
%35 = load i32, i32* %6
%36 = load i32, i32* %7
%37 = add nsw i32 %35, %36
store i32 %37, i32* %7
br label %38
38: ; preds = %34
%39 = load i32, i32* %2
%40 = add nsw i32 %39, 1
store i32 %40, i32* %2
br label %13
41: ; preds = %13
%42 = load i32, i32* %7
%43 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %42)
ret i32 0
}

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