#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, i;
  float countp = 0, countz = 0, countn = 0;
  scanf("%d", &n);
  int a[n];
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (a[i] > 0)
      countp++;
    else if (a[i] == 0)
      countz++;
    else
      countn++;
  }
  printf("%0.3f\n%0.3f\n%0.3f\n", countp / n, countn / n, countz / n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%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,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1225 <main+0x105>
mov    -0x30(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe60(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jle    11d2 <main+0xb2>
movss  0xe3d(%rip),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1212 <main+0xf2>
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    11fb <main+0xdb>
movss  0xe14(%rip),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    120d <main+0xed>
movss  0xdfd(%rip),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    1212 <main+0xf2>
jmp    1217 <main+0xf7>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1182 <main+0x62>
movss  -0x10(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  -0x18(%rbp),%xmm1
cvtsi2ssl -0x8(%rbp),%xmm2
divss  %xmm2,%xmm1
movss  -0x14(%rbp),%xmm2
cvtsi2ssl -0x8(%rbp),%xmm3
divss  %xmm3,%xmm2
lea    0xdb1(%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    -0x30(%rbp),%rsi
call   1040 <scanf@plt>
mov    %rsp,%r15
mov    -0x30(%rbp),%eax
mov    %rsp,%rbx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    -0x30(%rbp),%eax
test   %eax,%eax
jle    11f6 <main+0xd6>
xorps  %xmm1,%xmm1
xor    %r12d,%r12d
lea    0xe92(%rip),%r14
xorps  %xmm2,%xmm2
xorps  %xmm0,%xmm0
jmp    11a8 <main+0x88>
nopw   0x0(%rax,%rax,1)
movss  -0x24(%rbp),%xmm0
addss  0xe73(%rip),%xmm0
movss  -0x2c(%rbp),%xmm1
movss  -0x28(%rbp),%xmm2
add    $0x1,%r12
movslq -0x30(%rbp),%rax
add    $0x4,%rbx
cmp    %rax,%r12
jge    11ff <main+0xdf>
movss  %xmm0,-0x24(%rbp)
movss  %xmm2,-0x28(%rbp)
movss  %xmm1,-0x2c(%rbp)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmpl   $0x0,(%rbx)
jg     1180 <main+0x60>
je     11dd <main+0xbd>
movss  -0x2c(%rbp),%xmm1
addss  0xe2a(%rip),%xmm1
movss  -0x28(%rbp),%xmm2
jmp    11ef <main+0xcf>
movss  -0x28(%rbp),%xmm2
addss  0xe16(%rip),%xmm2
movss  -0x2c(%rbp),%xmm1
movss  -0x24(%rbp),%xmm0
jmp    1197 <main+0x77>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm3
divss  %xmm3,%xmm0
divss  %xmm3,%xmm1
divss  %xmm3,%xmm2
lea    0xdf1(%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 = [19 x i8] c"%0.3f\0A%0.3f\0A%0.3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca i8*
%8 = alloca i64
store i32 0, i32* %1
store float 0.000000e+00, float* %4
store float 0.000000e+00, float* %5
store float 0.000000e+00, float* %6
%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** %7
%13 = alloca i32, i64 %11
store i64 %11, i64* %8
store i32 0, i32* %3
br label %14
14: ; preds = %45, %0
%15 = load i32, i32* %3
%16 = load i32, i32* %2
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %48
18: ; preds = %14
%19 = load i32, i32* %3
%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* %3
%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* %4
%30 = fadd float %29, 1.000000e+00
store float %30, float* %4
br label %44
31: ; preds = %18
%32 = load i32, i32* %3
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i32, i32* %13, i64 %33
%35 = load i32, i32* %34
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %31
%38 = load float, float* %5
%39 = fadd float %38, 1.000000e+00
store float %39, float* %5
br label %43
40: ; preds = %31
%41 = load float, float* %6
%42 = fadd float %41, 1.000000e+00
store float %42, float* %6
br label %43
43: ; preds = %40, %37
br label %44
44: ; preds = %43, %28
br label %45
45: ; preds = %44
%46 = load i32, i32* %3
%47 = add nsw i32 %46, 1
store i32 %47, i32* %3
br label %14
48: ; preds = %14
%49 = load float, float* %4
%50 = load i32, i32* %2
%51 = sitofp i32 %50 to float
%52 = fdiv float %49, %51
%53 = load float, float* %6
%54 = load i32, i32* %2
%55 = sitofp i32 %54 to float
%56 = fdiv float %53, %55
%57 = load float, float* %5
%58 = load i32, i32* %2
%59 = sitofp i32 %58 to float
%60 = fdiv float %57, %59
%61 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), float %52, float %56, float %60)
store i32 0, i32* %1
%62 = load i8*, i8** %7
%63 = load i32, i32* %1
ret i32 %63
}

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