#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 count, step;
  float price, discount = 0, total = 0;
  scanf("%d", &count);
  scanf("%f", &price);
  scanf("%d", &step);
  for (int i = 1; i <= count; i++) {
    total += price - (price * discount / 100);
    if (!(i % step)) {
      discount += 2;
    }
  }
  printf("%.0f\n", total);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb3(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe9e(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11e6 <main+0xc6>
movss  -0x10(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
mulss  -0x14(%rbp),%xmm1
movss  0xe61(%rip),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    11d3 <main+0xb3>
movss  0xe3b(%rip),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    11d8 <main+0xb8>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    117c <main+0x5c>
movss  -0x18(%rbp),%xmm0
lea    0xe1c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xedc(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xec9(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
jle    11d6 <main+0xb6>
movss  0x4(%rsp),%xmm1
mov    0x8(%rsp),%edi
neg    %esi
xorps  %xmm0,%xmm0
mov    $0x1,%ecx
movss  0xe7f(%rip),%xmm2
movss  0xe7b(%rip),%xmm3
xorps  %xmm5,%xmm5
movaps %xmm5,%xmm4
jmp    11b9 <main+0x99>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
addss  %xmm1,%xmm6
addss  %xmm6,%xmm0
lea    (%rsi,%rcx,1),%eax
add    $0x1,%eax
add    $0x1,%ecx
movaps %xmm4,%xmm5
cmp    $0x1,%eax
je     11d9 <main+0xb9>
movaps %xmm5,%xmm6
mulss  %xmm1,%xmm6
divss  %xmm2,%xmm6
mov    %ecx,%eax
cltd
idiv   %edi
addss  %xmm3,%xmm4
test   %edx,%edx
je     11a0 <main+0x80>
movaps %xmm5,%xmm4
jmp    11a0 <main+0x80>
xorps  %xmm0,%xmm0
lea    0xe2e(%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 = [3 x i8] c"%f\00"
@.str.2 = [6 x i8] c"%.0f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca i32
store i32 0, i32* %1
store float 0.000000e+00, float* %5
store float 0.000000e+00, float* %6
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
store i32 1, i32* %7
br label %11
11: ; preds = %32, %0
%12 = load i32, i32* %7
%13 = load i32, i32* %2
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %35
15: ; preds = %11
%16 = load float, float* %4
%17 = load float, float* %4
%18 = load float, float* %5
%19 = fmul float %17, %18
%20 = fdiv float %19, 1.000000e+02
%21 = fsub float %16, %20
%22 = load float, float* %6
%23 = fadd float %22, %21
store float %23, float* %6
%24 = load i32, i32* %7
%25 = load i32, i32* %3
%26 = srem i32 %24, %25
%27 = icmp ne i32 %26, 0
br i1 %27, label %31, label %28
28: ; preds = %15
%29 = load float, float* %5
%30 = fadd float %29, 2.000000e+00
store float %30, float* %5
br label %31
31: ; preds = %28, %15
br label %32
32: ; preds = %31
%33 = load i32, i32* %7
%34 = add nsw i32 %33, 1
store i32 %34, i32* %7
br label %11
35: ; preds = %11
%36 = load float, float* %6
%37 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), float %36)
%38 = load i32, i32* %1
ret i32 %38
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [6 x i8] c"%.0f\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 %15, label %12
12: ; preds = %0
%13 = load float, float* %3
%14 = load i32, i32* %2
br label %18
15: ; preds = %18, %0
%16 = phi float [ 0.000000e+00, %0 ], [ %25, %18 ]
%17 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), float %16)
ret i32 0
18: ; preds = %12, %18
%19 = phi i32 [ 1, %12 ], [ %30, %18 ]
%20 = phi float [ 0.000000e+00, %12 ], [ %25, %18 ]
%21 = phi float [ 0.000000e+00, %12 ], [ %29, %18 ]
%22 = fmul float %21, %13
%23 = fdiv float %22, 1.000000e+02
%24 = fsub float %13, %23
%25 = fadd float %20, %24
%26 = srem i32 %19, %14
%27 = icmp eq i32 %26, 0
%28 = fadd float %21, 2.000000e+00
%29 = select i1 %27, float %28, float %21
%30 = add nuw i32 %19, 1
%31 = icmp eq i32 %19, %10
br i1 %31, label %15, label %18
}