#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 = 0, price = 0, i = 0, f = 0, m = 0, k = 0, otstupka = 0, sum = 0;
  scanf("%d", &n);
  scanf("%d", &m);
  scanf("%d", &k);
  f = n / k;
  while (i < f) {
    price = (m - otstupka) * k;
    sum = sum + price;
    otstupka = otstupka + 0.02 * m;
    i++;
  }
  printf("%d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
lea    0xe9a(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe8a(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe7a(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11f2 <main+0xd2>
mov    -0x18(%rbp),%eax
sub    -0x20(%rbp),%eax
imul   -0x1c(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x24(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
cvtsi2sdl -0x20(%rbp),%xmm1
cvtsi2sdl -0x18(%rbp),%xmm0
movsd  0xe2b(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11a1 <main+0x81>
mov    -0x24(%rbp),%esi
lea    0xe0f(%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
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
mov    0x4(%rsp),%r8d
cltd
idiv   %r8d
test   %eax,%eax
jle    118b <main+0x6b>
mov    0x8(%rsp),%esi
cmp    $0x1,%eax
jne    118f <main+0x6f>
xor    %edx,%edx
xor    %ebx,%ebx
jmp    11e8 <main+0xc8>
xor    %esi,%esi
jmp    11f5 <main+0xd5>
cvtsi2sd %esi,%xmm0
mov    %eax,%edi
and    $0xfffffffe,%edi
xor    %edx,%edx
mulsd  0xe5e(%rip),%xmm0
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %esi,%ecx
sub    %ebx,%ecx
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
imul   %r8d,%ecx
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%ebx
add    %edx,%ecx
mov    %esi,%edx
sub    %ebx,%edx
imul   %r8d,%edx
add    %ecx,%edx
cvttpd2dq %xmm1,%xmm1
cvtdq2pd %xmm1,%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%ebx
add    $0xfffffffe,%edi
jne    11b0 <main+0x90>
sub    %ebx,%esi
imul   %r8d,%esi
add    %edx,%esi
test   $0x1,%al
cmove  %edx,%esi
lea    0xe0f(%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
%9 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%13 = load i32, i32* %2
%14 = load i32, i32* %7
%15 = sdiv i32 %13, %14
store i32 %15, i32* %5
br label %16
16: ; preds = %20, %0
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %37
20: ; preds = %16
%21 = load i32, i32* %6
%22 = load i32, i32* %8
%23 = sub nsw i32 %21, %22
%24 = load i32, i32* %7
%25 = mul nsw i32 %23, %24
store i32 %25, i32* %3
%26 = load i32, i32* %9
%27 = load i32, i32* %3
%28 = add nsw i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %8
%30 = sitofp i32 %29 to double
%31 = load i32, i32* %6
%32 = sitofp i32 %31 to double
%33 = call double @llvm.fmuladd.f64(double 2.000000e-02, double %32, double %30)
%34 = fptosi double %33 to i32
store i32 %34, i32* %8
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 1
store i32 %36, i32* %4
br label %16
37: ; preds = %16
%38 = load i32, i32* %9
%39 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %38)
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*
store i32 0, i32* %1
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%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* %1
%11 = load i32, i32* %3
%12 = sdiv i32 %10, %11
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %48
14: ; preds = %0
%15 = load i32, i32* %2
%16 = sitofp i32 %15 to double
%17 = and i32 %12, 1
%18 = icmp eq i32 %12, 1
br i1 %18, label %39, label %19
19: ; preds = %14
%20 = and i32 %12, -2
br label %21
21: ; preds = %21, %19
%22 = phi i32 [ 0, %19 ], [ %33, %21 ]
%23 = phi i32 [ 0, %19 ], [ %36, %21 ]
%24 = phi i32 [ 0, %19 ], [ %37, %21 ]
%25 = sub nsw i32 %15, %23
%26 = mul nsw i32 %25, %11
%27 = add nsw i32 %26, %22
%28 = sitofp i32 %23 to double
%29 = call double @llvm.fmuladd.f64(double %16, double 2.000000e-02, double %28)
%30 = fptosi double %29 to i32
%31 = sub nsw i32 %15, %30
%32 = mul nsw i32 %31, %11
%33 = add nsw i32 %32, %27
%34 = sitofp i32 %30 to double
%35 = call double @llvm.fmuladd.f64(double %16, double 2.000000e-02, double %34)
%36 = fptosi double %35 to i32
%37 = add i32 %24, 2
%38 = icmp eq i32 %37, %20
br i1 %38, label %39, label %21
39: ; preds = %21, %14
%40 = phi i32 [ undef, %14 ], [ %33, %21 ]
%41 = phi i32 [ 0, %14 ], [ %33, %21 ]
%42 = phi i32 [ 0, %14 ], [ %36, %21 ]
%43 = icmp eq i32 %17, 0
%44 = sub nsw i32 %15, %42
%45 = mul nsw i32 %44, %11
%46 = add nsw i32 %45, %41
%47 = select i1 %43, i32 %40, i32 %46
br label %48
48: ; preds = %39, %0
%49 = phi i32 [ 0, %0 ], [ %47, %39 ]
%50 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %49)
ret i32 0
}