#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 *, float);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int n, k, i = 1, redu, c;
  float m, price = 0;
  scanf("%d", &n);
  scanf("%f", &m);
  scanf("%d", &k);
  redu = 0;
  while (i <= n) {
    c = m * redu / 100;
    price += m - c;
    if (i % k == 0) {
      redu += 2;
    }
    i++;
  }
  printf("%.f\n", price);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe9b(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11e7 <main+0xc7>
movss  -0x1c(%rbp),%xmm0
cvtsi2ssl -0x14(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xe63(%rip),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x18(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtsi2ssl -0x18(%rbp),%xmm1
subss  %xmm1,%xmm0
addss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    11d9 <main+0xb9>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    117b <main+0x5b>
movss  -0x20(%rbp),%xmm0
lea    0xe17(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xed6(%rip),%r14
xor    %ebx,%ebx
lea    0x14(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xec1(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x14(%rsp),%esi
test   %esi,%esi
jle    11d0 <main+0xb0>
movss  0xc(%rsp),%xmm1
mov    0x10(%rsp),%edi
neg    %esi
mov    $0x1,%ecx
xorps  %xmm0,%xmm0
movss  0xe7b(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
nop
xorps  %xmm3,%xmm3
cvtsi2ss %ebx,%xmm3
mulss  %xmm1,%xmm3
divss  %xmm2,%xmm3
cvttps2dq %xmm3,%xmm3
cvtdq2ps %xmm3,%xmm3
movaps %xmm1,%xmm4
subss  %xmm3,%xmm4
mov    %ecx,%eax
cltd
idiv   %edi
lea    0x2(%rbx),%eax
test   %edx,%edx
cmovne %ebx,%eax
addss  %xmm4,%xmm0
lea    (%rsi,%rcx,1),%edx
add    $0x1,%edx
add    $0x1,%ecx
mov    %eax,%ebx
cmp    $0x1,%edx
jne    1190 <main+0x70>
jmp    11d3 <main+0xb3>
xorps  %xmm0,%xmm0
lea    0xe30(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [5 x i8] c"%.f\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 float
%8 = alloca float
store i32 0, i32* %1
store i32 1, i32* %4
store float 0.000000e+00, float* %8
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %7)
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
store i32 0, i32* %5
br label %12
12: ; preds = %36, %0
%13 = load i32, i32* %4
%14 = load i32, i32* %2
%15 = icmp sle i32 %13, %14
br i1 %15, label %16, label %39
16: ; preds = %12
%17 = load float, float* %7
%18 = load i32, i32* %5
%19 = sitofp i32 %18 to float
%20 = fmul float %17, %19
%21 = fdiv float %20, 1.000000e+02
%22 = fptosi float %21 to i32
store i32 %22, i32* %6
%23 = load float, float* %7
%24 = load i32, i32* %6
%25 = sitofp i32 %24 to float
%26 = fsub float %23, %25
%27 = load float, float* %8
%28 = fadd float %27, %26
store float %28, float* %8
%29 = load i32, i32* %4
%30 = load i32, i32* %3
%31 = srem i32 %29, %30
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %16
%34 = load i32, i32* %5
%35 = add nsw i32 %34, 2
store i32 %35, i32* %5
br label %36
36: ; preds = %33, %16
%37 = load i32, i32* %4
%38 = add nsw i32 %37, 1
store i32 %38, i32* %4
br label %12
39: ; preds = %12
%40 = load float, float* %8
%41 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), float %40)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [5 x i8] c"%.f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %1
%11 = icmp slt i32 %10, 1
br i1 %11, label %32, label %12
12: ; preds = %0
%13 = load float, float* %3
%14 = load i32, i32* %2
br label %15
15: ; preds = %12, %15
%16 = phi float [ 0.000000e+00, %12 ], [ %25, %15 ]
%17 = phi i32 [ 1, %12 ], [ %30, %15 ]
%18 = phi i32 [ 0, %12 ], [ %29, %15 ]
%19 = sitofp i32 %18 to float
%20 = fmul float %13, %19
%21 = fdiv float %20, 1.000000e+02
%22 = fptosi float %21 to i32
%23 = sitofp i32 %22 to float
%24 = fsub float %13, %23
%25 = fadd float %16, %24
%26 = srem i32 %17, %14
%27 = icmp eq i32 %26, 0
%28 = add nsw i32 %18, 2
%29 = select i1 %27, i32 %28, i32 %18
%30 = add nuw i32 %17, 1
%31 = icmp eq i32 %17, %10
br i1 %31, label %32, label %15
32: ; preds = %15, %0
%33 = phi float [ 0.000000e+00, %0 ], [ %25, %15 ]
%34 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), float %33)
ret i32 0
}