#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, float, float);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, i, temp;
  float f1 = 0, f2 = 0, f3 = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &temp);
    if (temp > 0)
      f1++;
    else if (temp < 0)
      f2++;
    else
      f3++;
  }
  printf("%f\n%f\n%f", f1 / n, f2 / n, f3 / n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
lea    0xeb6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11e6 <main+0xc6>
lea    0xe93(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x10(%rbp)
jle    119b <main+0x7b>
movss  0xe74(%rip),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    11d3 <main+0xb3>
cmpl   $0x0,-0x10(%rbp)
jge    11bc <main+0x9c>
movss  0xe53(%rip),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    11ce <main+0xae>
movss  0xe3c(%rip),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    11d3 <main+0xb3>
jmp    11d8 <main+0xb8>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115e <main+0x3e>
movss  -0x14(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  -0x18(%rbp),%xmm1
cvtsi2ssl -0x8(%rbp),%xmm2
divss  %xmm2,%xmm1
movss  -0x1c(%rbp),%xmm2
cvtsi2ssl -0x8(%rbp),%xmm3
divss  %xmm3,%xmm2
lea    0xdf0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
lea    0xed5(%rip),%rdi
lea    0x18(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x18(%rsp),%eax
test   %eax,%eax
jle    11cf <main+0xaf>
xor    %ebp,%ebp
xorps  %xmm0,%xmm0
movss  %xmm0,0x10(%rsp)
lea    0xead(%rip),%r14
lea    0x1c(%rsp),%rbx
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x14(%rsp)
jmp    118f <main+0x6f>
movss  0x14(%rsp),%xmm0
addss  0xe82(%rip),%xmm0
movss  %xmm0,0x14(%rsp)
add    $0x1,%ebp
mov    0x18(%rsp),%eax
cmp    %eax,%ebp
jge    11ea <main+0xca>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x1c(%rsp)
jg     1170 <main+0x50>
js     11b9 <main+0x99>
movss  0x10(%rsp),%xmm0
addss  0xe4f(%rip),%xmm0
movss  %xmm0,0x10(%rsp)
jmp    1184 <main+0x64>
movss  0xc(%rsp),%xmm0
addss  0xe39(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
jmp    1184 <main+0x64>
xorps  %xmm0,%xmm0
movss  %xmm0,0x14(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x10(%rsp)
cvtsi2ss %eax,%xmm3
movss  0x14(%rsp),%xmm0
divss  %xmm3,%xmm0
movss  0xc(%rsp),%xmm1
divss  %xmm3,%xmm1
movss  0x10(%rsp),%xmm2
divss  %xmm3,%xmm2
lea    0xdf4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c"%f\0A%f\0A%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %5
store float 0.000000e+00, float* %6
store float 0.000000e+00, float* %7
%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* %4)
%15 = load i32, i32* %4
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load float, float* %5
%19 = fadd float %18, 1.000000e+00
store float %19, float* %5
br label %30
20: ; preds = %13
%21 = load i32, i32* %4
%22 = icmp slt i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load float, float* %6
%25 = fadd float %24, 1.000000e+00
store float %25, float* %6
br label %29
26: ; preds = %20
%27 = load float, float* %7
%28 = fadd float %27, 1.000000e+00
store float %28, float* %7
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 float, float* %5
%36 = load i32, i32* %2
%37 = sitofp i32 %36 to float
%38 = fdiv float %35, %37
%39 = load float, float* %6
%40 = load i32, i32* %2
%41 = sitofp i32 %40 to float
%42 = fdiv float %39, %41
%43 = load float, float* %7
%44 = load i32, i32* %2
%45 = sitofp i32 %44 to float
%46 = fdiv float %43, %45
%47 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float %38, float %42, float %46)
ret i32 0
}

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