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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11e6 <main+0xc6>
lea    0xe93(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x1c(%rbp)
jne    119b <main+0x7b>
movss  0xe74(%rip),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    11d3 <main+0xb3>
cmpl   $0x0,-0x1c(%rbp)
jle    11bc <main+0x9c>
movss  0xe53(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    11ce <main+0xae>
movss  0xe3c(%rip),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    11d3 <main+0xb3>
jmp    11d8 <main+0xb8>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115e <main+0x3e>
movss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
lea    0xe0c(%rip),%rdi
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
lea    0xdf2(%rip),%rdi
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
lea    0xdd8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
lea    0xed5(%rip),%rdi
lea    0x18(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x18(%rsp),%eax
xorps  %xmm0,%xmm0
test   %eax,%eax
jle    11d6 <main+0xb6>
movss  %xmm0,0x10(%rsp)
xor    %ebp,%ebp
lea    0xead(%rip),%r14
lea    0x1c(%rsp),%rbx
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x14(%rsp)
jmp    118f <main+0x6f>
movss  0x10(%rsp),%xmm0
addss  0xe82(%rip),%xmm0
movss  %xmm0,0x10(%rsp)
add    $0x1,%ebp
mov    0x18(%rsp),%eax
cmp    %eax,%ebp
jge    11ee <main+0xce>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x1c(%rsp)
je     1170 <main+0x50>
jle    11c0 <main+0xa0>
movss  0x14(%rsp),%xmm0
addss  0xe4f(%rip),%xmm0
movss  %xmm0,0x14(%rsp)
jmp    1184 <main+0x64>
nopl   0x0(%rax)
movss  0xc(%rsp),%xmm0
addss  0xe32(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
jmp    1184 <main+0x64>
movss  %xmm0,0x14(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x10(%rsp)
cvtsi2ss %eax,%xmm1
movss  0x14(%rsp),%xmm0
divss  %xmm1,%xmm0
lea    0xe04(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
xorps  %xmm1,%xmm1
cvtsi2ssl 0x18(%rsp),%xmm1
movss  0xc(%rsp),%xmm0
divss  %xmm1,%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xorps  %xmm1,%xmm1
cvtsi2ssl 0x18(%rsp),%xmm1
movss  0x10(%rsp),%xmm0
divss  %xmm1,%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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