#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 *, double, double, double);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, i, p = 0, N = 0, z = 0;
  scanf("%d", &n);
  int arr[n];
  for (i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
    if (arr[i] > 0)
      ++p;
    else if (arr[i] < 0)
      ++N;
    else
      ++z;
  }
  printf("%lf\n%lf\n%lf\n", (double)p / (double)n, (double)N / (double)n,
         (double)z / (double)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    0xeb5(%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    120a <main+0xea>
mov    -0x30(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe5c(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jle    11c9 <main+0xa9>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11f7 <main+0xd7>
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jge    11e9 <main+0xc9>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11f2 <main+0xd2>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11f7 <main+0xd7>
jmp    11fc <main+0xdc>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1182 <main+0x62>
cvtsi2sdl -0x10(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm2
divsd  %xmm2,%xmm1
cvtsi2sdl -0x18(%rbp),%xmm2
cvtsi2sdl -0x8(%rbp),%xmm3
divsd  %xmm3,%xmm2
lea    0xdc8(%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   %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    11bc <main+0x9c>
mov    %r14,-0x38(%rbp)
xor    %r13d,%r13d
lea    0xe8f(%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),%ecx
jmp    11c4 <main+0xa4>
xor    %r15d,%r15d
xor    %ecx,%ecx
xor    %r12d,%r12d
cvtsi2sd %r15d,%xmm0
cvtsi2sd %eax,%xmm3
divsd  %xmm3,%xmm0
cvtsi2sd %ecx,%xmm1
divsd  %xmm3,%xmm1
cvtsi2sd %r12d,%xmm2
divsd  %xmm3,%xmm2
lea    0xe1a(%rip),%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 = [13 x i8] c"%lf\0A%lf\0A%lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %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 i32, i32* %4
%30 = add nsw i32 %29, 1
store i32 %30, i32* %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 slt i32 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %31
%38 = load i32, i32* %5
%39 = add nsw i32 %38, 1
store i32 %39, i32* %5
br label %43
40: ; preds = %31
%41 = load i32, i32* %6
%42 = add nsw i32 %41, 1
store i32 %42, i32* %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 i32, i32* %4
%50 = sitofp i32 %49 to double
%51 = load i32, i32* %2
%52 = sitofp i32 %51 to double
%53 = fdiv double %50, %52
%54 = load i32, i32* %5
%55 = sitofp i32 %54 to double
%56 = load i32, i32* %2
%57 = sitofp i32 %56 to double
%58 = fdiv double %55, %57
%59 = load i32, i32* %6
%60 = sitofp i32 %59 to double
%61 = load i32, i32* %2
%62 = sitofp i32 %61 to double
%63 = fdiv double %60, %62
%64 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %53, double %58, double %63)
store i32 0, i32* %1
%65 = load i8*, i8** %7
%66 = load i32, i32* %1
ret i32 %66
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [13 x i8] c"%lf\0A%lf\0A%lf\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 ([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 = 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 double
%41 = sitofp i32 %39 to double
%42 = fdiv double %40, %41
%43 = sitofp i32 %37 to double
%44 = fdiv double %43, %41
%45 = sitofp i32 %38 to double
%46 = fdiv double %45, %41
%47 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %42, double %44, double %46)
ret i32 0
}