#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 */
float pow(float, float);
int /*<<< orphan*/ printf(char *, float, float);
int /*<<< orphan*/ scanf(char *, float *, float *, float *);
int main(void) {
  float a1, q, n, i, aux;
  float soma, an;
  scanf("%f %f %f", &a1, &q, &n);
  soma = ((a1 * (pow(q, n) - 1)) / (q - 1));
  an = (a1 * pow(q, n - 1));
  printf("%.2f\n%.2f", an, soma);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xebe(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movss  -0x28(%rbp),%xmm0
movss  0xe80(%rip),%xmm2
subss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
movss  0xe6b(%rip),%xmm2
subss  %xmm2,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  0xe42(%rip),%xmm2
subss  %xmm2,%xmm1
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movss  -0x24(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm1
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec9(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1040 <scanf@plt>
movss  0x10(%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
call   1050 <pow@plt>
movss  0xe8c(%rip),%xmm1
addss  %xmm1,%xmm0
movss  0x4(%rsp),%xmm3
mulss  %xmm0,%xmm3
movss  0xc(%rsp),%xmm0
movaps %xmm0,%xmm2
addss  %xmm1,%xmm2
divss  %xmm2,%xmm3
movss  %xmm3,0x4(%rsp)
movss  0x10(%rsp),%xmm2
movss  %xmm2,0x14(%rsp)
addss  0x8(%rsp),%xmm1
call   1050 <pow@plt>
mulss  0x14(%rsp),%xmm0
lea    0xe50(%rip),%rdi
movss  0x4(%rsp),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%f %f %f\00"
@.str.1 = [10 x i8] c"%.2f\0A%.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store i32 0, i32* %1
%9 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float* %2, float* %3, float* %4)
%10 = load float, float* %2
%11 = load float, float* %3
%12 = load float, float* %4
%13 = call float @pow(float %11, float %12)
%14 = fsub float %13, 1.000000e+00
%15 = fmul float %10, %14
%16 = load float, float* %3
%17 = fsub float %16, 1.000000e+00
%18 = fdiv float %15, %17
store float %18, float* %7
%19 = load float, float* %2
%20 = load float, float* %3
%21 = load float, float* %4
%22 = fsub float %21, 1.000000e+00
%23 = call float @pow(float %20, float %22)
%24 = fmul float %19, %23
store float %24, float* %8
%25 = load float, float* %8
%26 = load float, float* %7
%27 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), float %25, float %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%f %f %f\00"
@.str.1 = [10 x i8] c"%.2f\0A%.2f\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float* %1, float* %2, float* %3)
%8 = load float, float* %1
%9 = load float, float* %2
%10 = load float, float* %3
%11 = call float @pow(float %9, float %10)
%12 = fadd float %11, -1.000000e+00
%13 = fmul float %8, %12
%14 = load float, float* %2
%15 = fadd float %14, -1.000000e+00
%16 = fdiv float %13, %15
%17 = load float, float* %1
%18 = load float, float* %3
%19 = fadd float %18, -1.000000e+00
%20 = call float @pow(float %14, float %19)
%21 = fmul float %17, %20
%22 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), float %21, float %16)
ret i32 0
}