#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, i;
  scanf("%d", &n);
  int A[n];
  int p_count = 0;
  int n_count = 0;
  int z_count = 0;
  for (i = 0; i < n; i++) {
    scanf("%d ", &A[i]);
    if (A[i] > 0)
      p_count++;
    else if (A[i] < 0)
      n_count++;
    else
      z_count++;
  }
  printf("%.3f\n", (float)p_count / (float)n);
  printf("%.3f\n", (float)n_count / (float)n);
  printf("%.3f\n", (float)z_count / (float)n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    120a <main+0xea>
mov    -0x38(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe5f(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x38(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jle    11c9 <main+0xa9>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11f7 <main+0xd7>
mov    -0x38(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jge    11e9 <main+0xc9>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11f2 <main+0xd2>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11f7 <main+0xd7>
jmp    11fc <main+0xdc>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1182 <main+0x62>
cvtsi2ssl -0x24(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
lea    0xde8(%rip),%rdi
call   1030 <printf@plt>
cvtsi2ssl -0x28(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
lea    0xdce(%rip),%rdi
call   1030 <printf@plt>
cvtsi2ssl -0x2c(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
lea    0xdb4(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%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   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xec8(%rip),%rdi
lea    -0x2c(%rbp),%rsi
call   1040 <scanf@plt>
mov    %rsp,%r14
mov    -0x2c(%rbp),%eax
mov    %rsp,%rbx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    -0x2c(%rbp),%eax
test   %eax,%eax
jle    11bd <main+0x9d>
mov    %r14,-0x38(%rbp)
xor    %r13d,%r13d
lea    0xe92(%rip),%r14
xor    %r12d,%r12d
movl   $0x0,-0x30(%rbp)
xor    %r15d,%r15d
jmp    1195 <main+0x75>
add    $0x1,%r15d
add    $0x1,%r13
movslq -0x2c(%rbp),%rax
add    $0x4,%rbx
cmp    %rax,%r13
jge    11b3 <main+0x93>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmpl   $0x0,(%rbx)
jg     1180 <main+0x60>
js     11ad <main+0x8d>
add    $0x1,%r12d
jmp    1184 <main+0x64>
addl   $0x1,-0x30(%rbp)
jmp    1184 <main+0x64>
mov    -0x38(%rbp),%r14
mov    -0x30(%rbp),%r13d
jmp    11c6 <main+0xa6>
xor    %r15d,%r15d
xor    %r13d,%r13d
xor    %r12d,%r12d
cvtsi2ss %r15d,%xmm0
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
lea    0xe2d(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %r13d,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ssl -0x2c(%rbp),%xmm1
divss  %xmm1,%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %r12d,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ssl -0x2c(%rbp),%xmm1
divss  %xmm1,%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %r14,%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [6 x i8] c"%.3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%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** %4
%13 = alloca i32, i64 %11
store i64 %11, i64* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %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 ([4 x i8], [4 x i8]* @.str.1, 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 i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
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 slt i32 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %31
%38 = load i32, i32* %7
%39 = add nsw i32 %38, 1
store i32 %39, i32* %7
br label %43
40: ; preds = %31
%41 = load i32, i32* %8
%42 = add nsw i32 %41, 1
store i32 %42, i32* %8
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 i32, i32* %6
%50 = sitofp i32 %49 to float
%51 = load i32, i32* %2
%52 = sitofp i32 %51 to float
%53 = fdiv float %50, %52
%54 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), float %53)
%55 = load i32, i32* %7
%56 = sitofp i32 %55 to float
%57 = load i32, i32* %2
%58 = sitofp i32 %57 to float
%59 = fdiv float %56, %58
%60 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), float %59)
%61 = load i32, i32* %8
%62 = sitofp i32 %61 to float
%63 = load i32, i32* %2
%64 = sitofp i32 %63 to float
%65 = fdiv float %62, %64
%66 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), float %65)
store i32 0, i32* %1
%67 = load i8*, i8** %4
%68 = load i32, i32* %1
ret i32 %68
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [6 x i8] c"%.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 i32 [ %30, %27 ], [ 0, %0 ]
%13 = phi i32 [ %29, %27 ], [ 0, %0 ]
%14 = phi i32 [ %28, %27 ], [ 0, %0 ]
%15 = getelementptr inbounds i32, i32* %7, i64 %11
%16 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, 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 = add nsw i32 %14, 1
br label %27
21: ; preds = %10
%22 = icmp slt i32 %17, 0
br i1 %22, label %23, label %25
23: ; preds = %21
%24 = add nsw i32 %13, 1
br label %27
25: ; preds = %21
%26 = add nsw i32 %12, 1
br label %27
27: ; preds = %19, %25, %23
%28 = phi i32 [ %20, %19 ], [ %14, %23 ], [ %14, %25 ]
%29 = phi i32 [ %13, %19 ], [ %24, %23 ], [ %13, %25 ]
%30 = phi i32 [ %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 i32 [ 0, %0 ], [ %28, %27 ]
%37 = phi i32 [ 0, %0 ], [ %29, %27 ]
%38 = phi i32 [ 0, %0 ], [ %30, %27 ]
%39 = phi i32 [ %8, %0 ], [ %32, %27 ]
%40 = sitofp i32 %36 to float
%41 = sitofp i32 %39 to float
%42 = fdiv float %40, %41
%43 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), float %42)
%44 = sitofp i32 %37 to float
%45 = load i32, i32* %1
%46 = sitofp i32 %45 to float
%47 = fdiv float %44, %46
%48 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), float %47)
%49 = sitofp i32 %38 to float
%50 = load i32, i32* %1
%51 = sitofp i32 %50 to float
%52 = fdiv float %49, %51
%53 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), float %52)
ret i32 0
}