#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 = 0, i = 0, dsc = 0, m1;
  scanf("%d", &n);
  scanf("%d", &m);
  scanf("%d", &k);
  m1 = m;
  while (i < n) {
    if (i != 0 && i % k == 0) {
      dsc = dsc + 2;
      m = m1 - (m1 * dsc / 100);
    }
    sum = sum + m;
    i++;
  }
  printf("%d", sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xeb5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xea5(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe95(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11df <main+0xbf>
cmpl   $0x0,-0x18(%rbp)
je     11c8 <main+0xa8>
mov    -0x18(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    11c8 <main+0xa8>
mov    -0x1c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%eax
imul   -0x1c(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    117a <main+0x5a>
mov    -0x14(%rbp),%esi
lea    0xe17(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%r10d
test   %r10d,%r10d
jle    116d <main+0x4d>
mov    0x4(%rsp),%r8d
cmp    $0x1,%r10d
jne    1183 <main+0x63>
mov    %r8d,%esi
jmp    116f <main+0x4f>
xor    %esi,%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    0x8(%rsp),%r9d
mov    $0x1,%ecx
xor    %ebx,%ebx
mov    %r8d,%esi
mov    %r8d,%edi
jmp    11aa <main+0x8a>
nopw   0x0(%rax,%rax,1)
add    %edi,%esi
add    $0x1,%ecx
cmp    %ecx,%r10d
je     116f <main+0x4f>
mov    %ecx,%eax
cltd
idiv   %r9d
test   %edx,%edx
jne    11a0 <main+0x80>
add    $0x2,%ebx
mov    %ebx,%eax
imul   %r8d,%eax
cltq
imul   $0xffffffffae147ae1,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x25,%rdi
add    %eax,%edi
add    %r8d,%edi
mov    %edi,0x4(%rsp)
jmp    11a0 <main+0x80>

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* %5
store i32 0, i32* %6
store i32 0, i32* %7
%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* %8
br label %13
13: ; preds = %34, %0
%14 = load i32, i32* %6
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %40
17: ; preds = %13
%18 = load i32, i32* %6
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %34
20: ; preds = %17
%21 = load i32, i32* %6
%22 = load i32, i32* %4
%23 = srem i32 %21, %22
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %34
25: ; preds = %20
%26 = load i32, i32* %7
%27 = add nsw i32 %26, 2
store i32 %27, i32* %7
%28 = load i32, i32* %8
%29 = load i32, i32* %8
%30 = load i32, i32* %7
%31 = mul nsw i32 %29, %30
%32 = sdiv i32 %31, 100
%33 = sub nsw i32 %28, %32
store i32 %33, i32* %3
br label %34
34: ; preds = %25, %20, %17
%35 = load i32, i32* %5
%36 = load i32, i32* %3
%37 = add nsw i32 %35, %36
store i32 %37, i32* %5
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 1
store i32 %39, i32* %6
br label %13
40: ; preds = %13
%41 = load i32, i32* %5
%42 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %41)
%43 = load i32, i32* %1
ret i32 %43
}

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