#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 *);
int main() {
  int broi, pari, namalenie, i;
  scanf("%d", &broi);
  scanf("%d", &pari);
  scanf("%d", &namalenie);
  float sum = 0;
  i = 0;
  float procent_otstupka = 0.0;
  do {
    sum = sum + namalenie * pari * (1 - procent_otstupka);
    procent_otstupka = procent_otstupka + 0.02;
    i = i + namalenie;
  } while (i < broi);
  printf("%.f", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec6(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb6(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x18(%rbp),%xmm1
mov    -0x10(%rbp),%eax
imul   -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  0xe7a(%rip),%xmm2
subss  -0x1c(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe4f(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1176 <main+0x56>
movss  -0x18(%rbp),%xmm0
lea    0xe30(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee4(%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    0x4(%rsp),%eax
mov    0x8(%rsp),%ecx
imul   %eax,%ecx
cvtsi2ss %ecx,%xmm1
xorps  %xmm0,%xmm0
xor    %ecx,%ecx
mov    0xc(%rsp),%edx
movss  0xe8d(%rip),%xmm2
movsd  0xe8d(%rip),%xmm3
xorps  %xmm4,%xmm4
xchg   %ax,%ax
movaps %xmm2,%xmm5
subss  %xmm4,%xmm5
mulss  %xmm1,%xmm5
addss  %xmm5,%xmm0
cvtss2sd %xmm4,%xmm4
addsd  %xmm3,%xmm4
cvtsd2ss %xmm4,%xmm4
add    %eax,%ecx
cmp    %edx,%ecx
jl     1180 <main+0x60>
lea    0xe6b(%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"%.f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = alloca float
store i32 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 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
store float 0.000000e+00, float* %6
store i32 0, i32* %5
store float 0.000000e+00, float* %7
br label %11
11: ; preds = %27, %0
%12 = load float, float* %6
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = mul nsw i32 %13, %14
%16 = sitofp i32 %15 to float
%17 = load float, float* %7
%18 = fsub float 1.000000e+00, %17
%19 = call float @llvm.fmuladd.f32(float %16, float %18, float %12)
store float %19, float* %6
%20 = load float, float* %7
%21 = fpext float %20 to double
%22 = fadd double %21, 2.000000e-02
%23 = fptrunc double %22 to float
store float %23, float* %7
%24 = load i32, i32* %5
%25 = load i32, i32* %4
%26 = add nsw i32 %24, %25
store i32 %26, i32* %5
br label %27
27: ; preds = %11
%28 = load i32, i32* %5
%29 = load i32, i32* %2
%30 = icmp slt i32 %28, %29
br i1 %30, label %11, label %31
31: ; preds = %27
%32 = load float, float* %6
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %32)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%.f\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* %3
%11 = load i32, i32* %2
%12 = mul nsw i32 %11, %10
%13 = sitofp i32 %12 to float
%14 = load i32, i32* %1
br label %15
15: ; preds = %15, %0
%16 = phi i32 [ 0, %0 ], [ %24, %15 ]
%17 = phi float [ 0.000000e+00, %0 ], [ %20, %15 ]
%18 = phi float [ 0.000000e+00, %0 ], [ %23, %15 ]
%19 = fsub float 1.000000e+00, %18
%20 = call float @llvm.fmuladd.f32(float %13, float %19, float %17)
%21 = fpext float %18 to double
%22 = fadd double %21, 2.000000e-02
%23 = fptrunc double %22 to float
%24 = add nsw i32 %10, %16
%25 = icmp slt i32 %24, %14
br i1 %25, label %15, label %26
26: ; preds = %15
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %20)
ret i32 0
}