#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 */
scalar_t__ EOF;
double calculate(double *, double *);
int /*<<< orphan*/ printf(char *, double);
scalar_t__ scanf(char *, ...);
int main() {
  int n, m, i, u;
  double ar[3005], c[3005], *p, *q, A1;
  for (i = 0; i < 3005; i++)
    ar[i] = 0;
  while (scanf("%d", &n) != EOF) {
    scanf("%lf %lf", &ar[0], &ar[n + 1]);
    for (m = 1; m <= n; m++)
      scanf("%lf", &c[m]);
    p = &ar[0];
    q = &c[1];
    A1 = calculate(q, p);
    printf("%.2lf\n", A1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xbc10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xbbd,-0x10(%rbp)
jge    1174 <main+0x44>
movslq -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x5e00(%rbp,%rax,8)
ff ff
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1149 <main+0x19>
jmp    1179 <main+0x49>
lea    0xe80(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    0x2e56(%rip),%rcx
cmp    (%rcx),%rax
je     125b <main+0x12b>
lea    -0x5e00(%rbp),%rsi
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cltq
lea    -0x5e00(%rbp),%rdx
shl    $0x3,%rax
add    %rax,%rdx
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1207 <main+0xd7>
movslq -0xc(%rbp),%rax
lea    -0xbbf0(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11cd <main+0x9d>
lea    -0x5e00(%rbp),%rax
mov    %rax,-0xbbf8(%rbp)
lea    -0xbbf0(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0xbc00(%rbp)
mov    -0xbc00(%rbp),%rdi
mov    -0xbbf8(%rbp),%rsi
call   1040 <calculate@plt>
movsd  %xmm0,-0xbc08(%rbp)
ff
movsd  -0xbc08(%rbp),%xmm0
ff
lea    0xdba(%rip),%rdi
call   1030 <printf@plt>
jmp    1179 <main+0x49>
xor    %eax,%eax
add    $0xbc10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xbbe8,%rsp
lea    0x10(%rsp),%rdi
mov    $0x5de8,%edx
xor    %esi,%esi
call   1050 <memset@plt>
lea    0xe97(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0x2e6c(%rip),%rcx
cmp    (%rcx),%rax
jne    1195 <main+0x55>
xor    %eax,%eax
add    $0xbbe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x5e08(%rsp),%r12
lea    0x10(%rsp),%rbx
lea    0xc(%rsp),%rbp
lea    0xe59(%rip),%r14
jmp    11e4 <main+0xa4>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <calculate@plt>
lea    0xe49(%rip),%rdi
call   1030 <printf@plt>
lea    0xe32(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0x2e09(%rip),%rcx
cmp    (%rcx),%rax
je     1181 <main+0x41>
movslq 0xc(%rsp),%rax
lea    (%rsp,%rax,8),%rdx
add    $0x18,%rdx
lea    0xe0b(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11b0 <main+0x70>
mov    %r12,%r15
xor    %r13d,%r13d
nop
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
movslq 0xc(%rsp),%rax
add    $0x1,%r13
add    $0x8,%r15
cmp    %rax,%r13
jl     1210 <main+0xd0>
jmp    11b0 <main+0x70>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [8 x i8] c"%lf %lf\00"
@.str.2 = [4 x i8] c"%lf\00"
@.str.3 = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [3005 x double]
%7 = alloca [3005 x double]
%8 = alloca double*
%9 = alloca double*
%10 = alloca double
store i32 0, i32* %1
store i32 0, i32* %4
br label %11
11: ; preds = %18, %0
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 3005
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [3005 x double], [3005 x double]* %6, i64 0, i64 %16
store double 0.000000e+00, double* %17
br label %18
18: ; preds = %14
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %11
21: ; preds = %11
br label %22
22: ; preds = %45, %21
%23 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%24 = load i64, i64* @EOF
%25 = icmp ne i64 %23, %24
br i1 %25, label %26, label %53
26: ; preds = %22
%27 = getelementptr inbounds [3005 x double], [3005 x double]* %6, i64 0, i64 0
%28 = load i32, i32* %2
%29 = add nsw i32 %28, 1
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [3005 x double], [3005 x double]* %6, i64 0, i64 %30
%32 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double* %27, double* %31)
store i32 1, i32* %3
br label %33
33: ; preds = %42, %26
%34 = load i32, i32* %3
%35 = load i32, i32* %2
%36 = icmp sle i32 %34, %35
br i1 %36, label %37, label %45
37: ; preds = %33
%38 = load i32, i32* %3
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [3005 x double], [3005 x double]* %7, i64 0, i64 %39
%41 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %40)
br label %42
42: ; preds = %37
%43 = load i32, i32* %3
%44 = add nsw i32 %43, 1
store i32 %44, i32* %3
br label %33
45: ; preds = %33
%46 = getelementptr inbounds [3005 x double], [3005 x double]* %6, i64 0, i64 0
store double* %46, double** %8
%47 = getelementptr inbounds [3005 x double], [3005 x double]* %7, i64 0, i64 1
store double* %47, double** %9
%48 = load double*, double** %9
%49 = load double*, double** %8
%50 = call double @calculate(double* %48, double* %49)
store double %50, double* %10
%51 = load double, double* %10
%52 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %51)
br label %22
53: ; preds = %22
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [8 x i8] c"%lf %lf\00"
@.str.2 = [4 x i8] c"%lf\00"
@.str.3 = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3005 x double]
%3 = bitcast [3005 x double]* %2 to i8*
%4 = alloca [3005 x double]
%5 = bitcast i32* %1 to i8*
%6 = bitcast [3005 x double]* %4 to i8*
%7 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %35, label %10
10: ; preds = %0
%11 = getelementptr inbounds [3005 x double], [3005 x double]* %2, i64 0, i64 0
%12 = getelementptr inbounds [3005 x double], [3005 x double]* %4, i64 0, i64 1
br label %13
13: ; preds = %10, %29
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [3005 x double], [3005 x double]* %2, i64 0, i64 %16
%18 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double* %11, double* %17)
%19 = load i32, i32* %1
%20 = icmp slt i32 %19, 1
br i1 %20, label %29, label %21
21: ; preds = %13, %21
%22 = phi i64 [ %25, %21 ], [ 1, %13 ]
%23 = getelementptr inbounds [3005 x double], [3005 x double]* %4, i64 0, i64 %22
%24 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %23)
%25 = add nuw nsw i64 %22, 1
%26 = load i32, i32* %1
%27 = sext i32 %26 to i64
%28 = icmp slt i64 %22, %27
br i1 %28, label %21, label %29
29: ; preds = %21, %13
%30 = call double @calculate(double* %12, double* %11)
%31 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %30)
%32 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%33 = load i64, i64* @EOF
%34 = icmp eq i64 %32, %33
br i1 %34, label %35, label %13
35: ; preds = %29, %0
ret i32 0
}