#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 main() {
  int i, a[1000];
  float n, x, y, z, c1, c2, c3;
  scanf("%f", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (a[i] > 0) {
      x += 1;
    }
    if (a[i] < 0) {
      y += 1;
    }
    if (a[i] == 0) {
      z += 1;
    }
  }
  c1 = x / n;
  printf("%f\n", c1);
  c2 = y / n;
  printf("%f\n", c2);
  c3 = z / n;
  printf("%f\n", c3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecb(%rip),%rdi
lea    -0xfb4(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x8(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm1
movss  -0xfb4(%rbp),%xmm0
ff
ucomiss %xmm1,%xmm0
jbe    1215 <main+0xf5>
movslq -0x8(%rbp),%rax
lea    -0xfb0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
movslq -0x8(%rbp),%rax
cmpl   $0x0,-0xfb0(%rbp,%rax,4)
jle    11ae <main+0x8e>
movss  0xe62(%rip),%xmm0
addss  -0xfb8(%rbp),%xmm0
ff
movss  %xmm0,-0xfb8(%rbp)
ff
movslq -0x8(%rbp),%rax
cmpl   $0x0,-0xfb0(%rbp,%rax,4)
jge    11d8 <main+0xb8>
movss  0xe38(%rip),%xmm0
addss  -0xfbc(%rbp),%xmm0
ff
movss  %xmm0,-0xfbc(%rbp)
ff
movslq -0x8(%rbp),%rax
cmpl   $0x0,-0xfb0(%rbp,%rax,4)
jne    1202 <main+0xe2>
movss  0xe0e(%rip),%xmm0
addss  -0xfc0(%rbp),%xmm0
ff
movss  %xmm0,-0xfc0(%rbp)
ff
jmp    1207 <main+0xe7>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114e <main+0x2e>
movss  -0xfb8(%rbp),%xmm0
ff
divss  -0xfb4(%rbp),%xmm0
ff
movss  %xmm0,-0xfc4(%rbp)
ff
movss  -0xfc4(%rbp),%xmm0
ff
lea    0xdce(%rip),%rdi
call   1030 <printf@plt>
movss  -0xfbc(%rbp),%xmm0
ff
divss  -0xfb4(%rbp),%xmm0
ff
movss  %xmm0,-0xfc8(%rbp)
ff
movss  -0xfc8(%rbp),%xmm0
ff
lea    0xda2(%rip),%rdi
call   1030 <printf@plt>
movss  -0xfc0(%rbp),%xmm0
ff
divss  -0xfb4(%rbp),%xmm0
ff
movss  %xmm0,-0xfcc(%rbp)
ff
movss  -0xfcc(%rbp),%xmm0
ff
lea    0xd76(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xfd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0xfb0,%rsp
lea    0xed2(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movss  (%rsp),%xmm2
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm2
jbe    11d2 <main+0xb2>
lea    0x10(%rsp),%rbx
mov    $0x1,%ebp
lea    0xea9(%rip),%r14
jmp    1178 <main+0x58>
xorps  %xmm1,%xmm1
cvtsi2ss %ebp,%xmm1
movss  (%rsp),%xmm2
add    $0x4,%rbx
add    $0x1,%ebp
ucomiss %xmm1,%xmm2
jbe    11d2 <main+0xb2>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,(%rbx)
jg     1190 <main+0x70>
js     11a6 <main+0x86>
jne    1160 <main+0x40>
jmp    11bc <main+0x9c>
movss  0x4(%rsp),%xmm0
addss  0xe62(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
jns    118c <main+0x6c>
movss  0x8(%rsp),%xmm0
addss  0xe4c(%rip),%xmm0
movss  %xmm0,0x8(%rsp)
jne    1160 <main+0x40>
movss  0xc(%rsp),%xmm0
addss  0xe36(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
jmp    1160 <main+0x40>
movss  0x4(%rsp),%xmm0
divss  %xmm2,%xmm0
lea    0xe27(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0x8(%rsp),%xmm0
divss  (%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
divss  (%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xfb0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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