#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*/ free(unsigned int *);
int /*<<< orphan*/ insert(unsigned int *, int, unsigned int);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, unsigned int);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  unsigned int *v, tmp;
  int n, i;
  scanf("%d", &n);
  v = (unsigned int *)malloc((n / 2 + 1) * sizeof(unsigned int));
  for (i = 0; i < n / 2 + 1; i++) {
    v[i] = 0;
  }
  for (i = 0; i < n; i++) {
    scanf("%u", &tmp);
    insert(v, n, tmp);
  }
  if (n % 2 == 0) {
    printf("%.1lf\n", ((double)v[0] + v[1]) / 2);
  } else
    printf("%u.0\n", v[0]);
  free(v);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea2(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
add    $0x1,%ecx
cmp    %ecx,%eax
jge    11d5 <main+0x85>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1197 <main+0x47>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1217 <main+0xc7>
lea    0xe1c(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1070 <insert@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11dc <main+0x8c>
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1266 <main+0x116>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    0x4(%rax),%eax
cvtsi2sd %rcx,%xmm0
cvtsi2sd %rax,%xmm1
addsd  %xmm1,%xmm0
movsd  0xdb6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %eax,%esi
lea    0xdb2(%rip),%rdi
call   1040 <printf@plt>
jmp    1278 <main+0x128>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xda2(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xeaa(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    (%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
lea    (%rcx,%rcx,1),%edi
add    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    (%rsp),%eax
cmp    $0xffffffff,%eax
jl     1206 <main+0xb6>
mov    $0xffffffffffffffff,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movl   $0x0,0x4(%rbx,%rcx,4)
mov    (%rsp),%eax
mov    %eax,%edx
shr    $0x1f,%edx
add    %eax,%edx
sar    %edx
movslq %edx,%rdx
add    $0x1,%rcx
cmp    %rdx,%rcx
jl     11a0 <main+0x50>
test   %eax,%eax
jle    1206 <main+0xb6>
lea    0xe40(%rip),%r14
lea    0x4(%rsp),%r15
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
mov    %rbx,%rdi
call   1070 <insert@plt>
add    $0x1,%ebp
mov    (%rsp),%eax
cmp    %eax,%ebp
jl     11e0 <main+0x90>
mov    (%rbx),%esi
test   $0x1,%al
jne    1235 <main+0xe5>
mov    %esi,%eax
cvtsi2sd %rax,%xmm0
mov    0x4(%rbx),%eax
cvtsi2sd %rax,%xmm1
addsd  %xmm0,%xmm1
mulsd  0xdd9(%rip),%xmm1
cvttsd2si %xmm1,%rsi
lea    0xddb(%rip),%rdi
jmp    123c <main+0xec>
lea    0xdd9(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%u\00"
@.str.2 = [7 x i8] c"%.1lf\0A\00"
@.str.3 = [6 x i8] c"%u.0\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%7 = load i32, i32* %4
%8 = sdiv i32 %7, 2
%9 = add nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to i32*
store i32* %14, i32** %2
store i32 0, i32* %5
br label %15
15: ; preds = %26, %0
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = sdiv i32 %17, 2
%19 = add nsw i32 %18, 1
%20 = icmp slt i32 %16, %19
br i1 %20, label %21, label %29
21: ; preds = %15
%22 = load i32*, i32** %2
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %22, i64 %24
store i32 0, i32* %25
br label %26
26: ; preds = %21
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %15
29: ; preds = %15
store i32 0, i32* %5
br label %30
30: ; preds = %40, %29
%31 = load i32, i32* %5
%32 = load i32, i32* %4
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %43
34: ; preds = %30
%35 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%36 = load i32*, i32** %2
%37 = load i32, i32* %4
%38 = load i32, i32* %3
%39 = call i32 @insert(i32* %36, i32 %37, i32 %38)
br label %40
40: ; preds = %34
%41 = load i32, i32* %5
%42 = add nsw i32 %41, 1
store i32 %42, i32* %5
br label %30
43: ; preds = %30
%44 = load i32, i32* %4
%45 = srem i32 %44, 2
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %60
47: ; preds = %43
%48 = load i32*, i32** %2
%49 = getelementptr inbounds i32, i32* %48, i64 0
%50 = load i32, i32* %49
%51 = uitofp i32 %50 to double
%52 = load i32*, i32** %2
%53 = getelementptr inbounds i32, i32* %52, i64 1
%54 = load i32, i32* %53
%55 = uitofp i32 %54 to double
%56 = fadd double %51, %55
%57 = fdiv double %56, 2.000000e+00
%58 = fptoui double %57 to i32
%59 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %58)
br label %65
60: ; preds = %43
%61 = load i32*, i32** %2
%62 = getelementptr inbounds i32, i32* %61, i64 0
%63 = load i32, i32* %62
%64 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %63)
br label %65
65: ; preds = %60, %47
%66 = load i32*, i32** %2
%67 = call i32 @free(i32* %66)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%u\00"
@.str.2 = [7 x i8] c"%.1lf\0A\00"
@.str.3 = [6 x i8] c"%u.0\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 2
%8 = shl i32 %7, 2
%9 = add i32 %8, 4
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i32*
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, -1
br i1 %13, label %33, label %16
14: ; preds = %16
%15 = icmp sgt i32 %20, 0
br i1 %15, label %24, label %33
16: ; preds = %0, %16
%17 = phi i64 [ %19, %16 ], [ 0, %0 ]
%18 = getelementptr inbounds i32, i32* %11, i64 %17
store i32 0, i32* %18
%19 = add nuw nsw i64 %17, 1
%20 = load i32, i32* %2
%21 = sdiv i32 %20, 2
%22 = sext i32 %21 to i64
%23 = icmp slt i64 %17, %22
br i1 %23, label %16, label %14
24: ; preds = %14, %24
%25 = phi i32 [ %30, %24 ], [ 0, %14 ]
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%27 = load i32, i32* %2
%28 = load i32, i32* %1
%29 = call i32 @insert(i32* %11, i32 %27, i32 %28)
%30 = add nuw nsw i32 %25, 1
%31 = load i32, i32* %2
%32 = icmp slt i32 %30, %31
br i1 %32, label %24, label %33
33: ; preds = %24, %0, %14
%34 = phi i32 [ %20, %14 ], [ %12, %0 ], [ %31, %24 ]
%35 = and i32 %34, 1
%36 = icmp eq i32 %35, 0
%37 = load i32, i32* %11
br i1 %36, label %38, label %47
38: ; preds = %33
%39 = uitofp i32 %37 to double
%40 = getelementptr inbounds i32, i32* %11, i64 1
%41 = load i32, i32* %40
%42 = uitofp i32 %41 to double
%43 = fadd double %39, %42
%44 = fmul double %43, 5.000000e-01
%45 = fptoui double %44 to i32
%46 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %45)
br label %49
47: ; preds = %33
%48 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %37)
br label %49
49: ; preds = %47, %38
%50 = call i32 @free(i32* %11)
ret i32 0
}