#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, float, float);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  float pos = 0, neg = 0, zero = 0;
  scanf("%d", &n);
  int arr[n];
  for (int arr_i = 0; arr_i < n; arr_i++) {
    scanf("%d", &arr[arr_i]);
    if (arr[arr_i] > 0)
      pos++;
    if (arr[arr_i] < 0)
      neg++;
    if (arr[arr_i] == 0)
      zero++;
  }
  printf("%.6f\n%.6f\n%.6f\n", pos / n, neg / n, zero / n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeb9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1228 <main+0x108>
mov    -0x38(%rbp),%rsi
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe60(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x38(%rbp),%rax
movslq -0x2c(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jle    11cd <main+0xad>
movss  0xe3d(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x2c(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jge    11f1 <main+0xd1>
movss  0xe19(%rip),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x2c(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1215 <main+0xf5>
movss  0xdf5(%rip),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    121a <main+0xfa>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1182 <main+0x62>
movss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  -0x10(%rbp),%xmm1
cvtsi2ssl -0x8(%rbp),%xmm2
divss  %xmm2,%xmm1
movss  -0x14(%rbp),%xmm2
cvtsi2ssl -0x8(%rbp),%xmm3
divss  %xmm3,%xmm2
lea    0xdae(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xece(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <scanf@plt>
mov    %rsp,%r15
mov    -0x24(%rbp),%eax
mov    %rsp,%rbx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    -0x24(%rbp),%eax
test   %eax,%eax
jle    11ed <main+0xcd>
xorps  %xmm0,%xmm0
xor    %r12d,%r12d
lea    0xe92(%rip),%r14
xorps  %xmm2,%xmm2
xorps  %xmm1,%xmm1
jmp    1191 <main+0x71>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r12
movslq -0x24(%rbp),%rax
add    $0x4,%rbx
cmp    %rax,%r12
jge    11f6 <main+0xd6>
movss  %xmm1,-0x2c(%rbp)
movss  %xmm2,-0x30(%rbp)
movss  %xmm0,-0x28(%rbp)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmpl   $0x0,(%rbx)
jg     11c0 <main+0xa0>
movss  -0x28(%rbp),%xmm0
jmp    11cd <main+0xad>
nopw   0x0(%rax,%rax,1)
movss  -0x28(%rbp),%xmm0
addss  0xe33(%rip),%xmm0
movss  -0x30(%rbp),%xmm2
movss  -0x2c(%rbp),%xmm1
jns    11e1 <main+0xc1>
addss  0xe1f(%rip),%xmm1
jne    1180 <main+0x60>
addss  0xe15(%rip),%xmm2
jmp    1180 <main+0x60>
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm3
divss  %xmm3,%xmm0
divss  %xmm3,%xmm1
divss  %xmm3,%xmm2
lea    0xdfa(%rip),%rdi
call   1030 <printf@plt>
mov    %r15,%rsp
xor    %eax,%eax
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [16 x i8] c"%.6f\0A%.6f\0A%.6f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = zext i32 %4 to i64
%6 = call i8* @llvm.stacksave()
%7 = alloca i32, i64 %5
%8 = load i32, i32* %1
%9 = icmp sgt i32 %8, 0
br i1 %9, label %20, label %10
10: ; preds = %20, %0
%11 = phi float [ 0.000000e+00, %0 ], [ %33, %20 ]
%12 = phi float [ 0.000000e+00, %0 ], [ %36, %20 ]
%13 = phi float [ 0.000000e+00, %0 ], [ %30, %20 ]
%14 = phi i32 [ %8, %0 ], [ %38, %20 ]
%15 = sitofp i32 %14 to float
%16 = fdiv float %13, %15
%17 = fdiv float %11, %15
%18 = fdiv float %12, %15
%19 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), float %16, float %17, float %18)
ret i32 0
20: ; preds = %0, %20
%21 = phi i64 [ %37, %20 ], [ 0, %0 ]
%22 = phi float [ %30, %20 ], [ 0.000000e+00, %0 ]
%23 = phi float [ %36, %20 ], [ 0.000000e+00, %0 ]
%24 = phi float [ %33, %20 ], [ 0.000000e+00, %0 ]
%25 = getelementptr inbounds i32, i32* %7, i64 %21
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %25)
%27 = load i32, i32* %25
%28 = icmp sgt i32 %27, 0
%29 = fadd float %22, 1.000000e+00
%30 = select i1 %28, float %29, float %22
%31 = icmp slt i32 %27, 0
%32 = fadd float %24, 1.000000e+00
%33 = select i1 %31, float %32, float %24
%34 = icmp eq i32 %27, 0
%35 = fadd float %23, 1.000000e+00
%36 = select i1 %34, float %35, float %23
%37 = add nuw nsw i64 %21, 1
%38 = load i32, i32* %1
%39 = sext i32 %38 to i64
%40 = icmp slt i64 %37, %39
br i1 %40, label %20, label %10
}