#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;
  int i = 0;
  int negatives = 0;
  int positives = 0;
  int zeroes = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    int value;
    scanf("%d", &value);
    if (value > 0)
      positives++;
    else if (value < 0)
      negatives++;
    else
      zeroes++;
  }
  printf("%.3f\n", (float)positives / n);
  printf("%.3f\n", (float)negatives / n);
  printf("%.3f\n", (float)zeroes / n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xeae(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11cf <main+0xaf>
lea    0xe8b(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x1c(%rbp)
jle    1196 <main+0x76>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11bc <main+0x9c>
cmpl   $0x0,-0x1c(%rbp)
jge    11ae <main+0x8e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11b7 <main+0x97>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11bc <main+0x9c>
jmp    11c1 <main+0xa1>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1162 <main+0x42>
cvtsi2ssl -0x14(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
lea    0xe1f(%rip),%rdi
call   1030 <printf@plt>
cvtsi2ssl -0x10(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
lea    0xe05(%rip),%rdi
call   1030 <printf@plt>
cvtsi2ssl -0x18(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
lea    0xdeb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xece(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%eax
test   %eax,%eax
jle    118d <main+0x6d>
xor    %r12d,%r12d
lea    0xeb5(%rip),%r14
lea    0x4(%rsp),%r13
xor    %ebp,%ebp
xor    %r15d,%r15d
xor    %ebx,%ebx
jmp    116d <main+0x4d>
nopl   0x0(%rax)
add    $0x1,%ebp
add    $0x1,%ebx
mov    (%rsp),%eax
cmp    %eax,%ebx
jge    1195 <main+0x75>
mov    %r14,%rdi
mov    %r13,%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jg     1160 <main+0x40>
js     1187 <main+0x67>
add    $0x1,%r12d
jmp    1163 <main+0x43>
add    $0x1,%r15d
jmp    1163 <main+0x43>
xor    %r15d,%r15d
xor    %ebp,%ebp
xor    %r12d,%r12d
cvtsi2ss %ebp,%xmm0
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
lea    0xe5b(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %r15d,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ssl (%rsp),%xmm1
divss  %xmm1,%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %r12d,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ssl (%rsp),%xmm1
divss  %xmm1,%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%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 = [6 x i8] c"%.3f\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 i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %3
br label %9
9: ; preds = %31, %0
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %34
13: ; preds = %9
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%15 = load i32, i32* %7
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %30
20: ; preds = %13
%21 = load i32, i32* %7
%22 = icmp slt i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %29
26: ; preds = %20
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
br label %29
29: ; preds = %26, %23
br label %30
30: ; preds = %29, %17
br label %31
31: ; preds = %30
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %9
34: ; preds = %9
%35 = load i32, i32* %5
%36 = sitofp i32 %35 to float
%37 = load i32, i32* %2
%38 = sitofp i32 %37 to float
%39 = fdiv float %36, %38
%40 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float %39)
%41 = load i32, i32* %4
%42 = sitofp i32 %41 to float
%43 = load i32, i32* %2
%44 = sitofp i32 %43 to float
%45 = fdiv float %42, %44
%46 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float %45)
%47 = load i32, i32* %6
%48 = sitofp i32 %47 to float
%49 = load i32, i32* %2
%50 = sitofp i32 %49 to float
%51 = fdiv float %48, %50
%52 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float %51)
ret i32 0
}

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