#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;
  float i, j, k;
  i = j = k = 0.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)
      i++;
    if (arr[arr_i] > 0)
      j++;
    if (arr[arr_i] < 0)
      k++;
  }
  printf("%f\n", j / n);
  printf("%f\n", k / n);
  printf("%f\n", i / n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%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)
jne    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)
jle    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)
jge    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  -0x10(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
lea    0xdca(%rip),%rdi
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
lea    0xdb0(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
lea    0xd96(%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    -0x28(%rbp),%rsi
call   1040 <scanf@plt>
mov    %rsp,%r15
mov    -0x28(%rbp),%eax
mov    %rsp,%rbx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    -0x28(%rbp),%eax
xorps  %xmm0,%xmm0
test   %eax,%eax
jle    1209 <main+0xe9>
movss  %xmm0,-0x24(%rbp)
xor    %r12d,%r12d
lea    0xe8d(%rip),%r14
xorps  %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
jmp    11ab <main+0x8b>
nopl   0x0(%rax)
movss  %xmm1,-0x2c(%rbp)
movss  %xmm0,-0x24(%rbp)
add    $0x1,%r12
movslq -0x28(%rbp),%rax
add    $0x4,%rbx
cmp    %rax,%r12
jge    1202 <main+0xe2>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmpl   $0x0,(%rbx)
je     11d0 <main+0xb0>
movss  -0x24(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm1
jg     11e4 <main+0xc4>
jmp    11f6 <main+0xd6>
nopl   0x0(%rax)
movss  -0x24(%rbp),%xmm0
addss  0xe23(%rip),%xmm0
movss  -0x2c(%rbp),%xmm1
jle    11f6 <main+0xd6>
movss  -0x30(%rbp),%xmm2
addss  0xe0f(%rip),%xmm2
movss  %xmm2,-0x30(%rbp)
jns    1190 <main+0x70>
addss  0xe00(%rip),%xmm1
jmp    1190 <main+0x70>
movss  -0x30(%rbp),%xmm0
jmp    1219 <main+0xf9>
xorps  %xmm1,%xmm1
movss  %xmm1,-0x2c(%rbp)
xorps  %xmm1,%xmm1
movss  %xmm1,-0x24(%rbp)
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
lea    0xddc(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
xorps  %xmm1,%xmm1
cvtsi2ssl -0x28(%rbp),%xmm1
movss  -0x2c(%rbp),%xmm0
divss  %xmm1,%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xorps  %xmm1,%xmm1
cvtsi2ssl -0x28(%rbp),%xmm1
movss  -0x24(%rbp),%xmm0
divss  %xmm1,%xmm0
mov    %rbx,%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 = [4 x i8] c"%f\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* %5
store float 0.000000e+00, float* %4
store float 0.000000e+00, float* %3
%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 eq 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 sgt 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 slt 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* %4
%55 = load i32, i32* %2
%56 = sitofp i32 %55 to float
%57 = fdiv float %54, %56
%58 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %57)
%59 = load float, float* %5
%60 = load i32, i32* %2
%61 = sitofp i32 %60 to float
%62 = fdiv float %59, %61
%63 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %62)
%64 = load float, float* %3
%65 = load i32, i32* %2
%66 = sitofp i32 %65 to float
%67 = fdiv float %64, %66
%68 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %67)
store i32 0, i32* %1
%69 = load i8*, i8** %6
%70 = load i32, i32* %1
ret i32 %70
}

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