#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 *, int *);
int main() {
  int a, d, n;
  scanf("%d %d %d", &a, &d, &n);
  printf("%d", (int)((float)n / 2 * (2 * a + (n - 1) * d)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
cvtsi2ssl -0x10(%rbp),%xmm0
movss  0xeac(%rip),%xmm1
divss  %xmm1,%xmm0
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%esi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cvtsi2ss %eax,%xmm0
mulss  0xeb1(%rip),%xmm0
mov    0x14(%rsp),%ecx
add    $0xffffffff,%eax
imul   0x10(%rsp),%eax
lea    (%rax,%rcx,2),%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%6 = load i32, i32* %4
%7 = sitofp i32 %6 to float
%8 = fdiv float %7, 2.000000e+00
%9 = load i32, i32* %2
%10 = mul nsw i32 2, %9
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
%13 = load i32, i32* %3
%14 = mul nsw i32 %12, %13
%15 = add nsw i32 %10, %14
%16 = sitofp i32 %15 to float
%17 = fmul float %8, %16
%18 = fptosi float %17 to i32
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [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 ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %3
%9 = sitofp i32 %8 to float
%10 = fmul float %9, 5.000000e-01
%11 = load i32, i32* %1
%12 = shl nsw i32 %11, 1
%13 = add nsw i32 %8, -1
%14 = load i32, i32* %2
%15 = mul nsw i32 %14, %13
%16 = add nsw i32 %15, %12
%17 = sitofp i32 %16 to float
%18 = fmul float %10, %17
%19 = fptosi float %18 to i32
%20 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %19)
ret i32 0
}