Given an array of integers, calculate the ratios of its elements that are positive,  negative, and zero. Print the decimal value of each fraction on a new line with $6$ places after the decimal.

Note: This challenge introduces precision problems. The test cases are scaled to six decimal places, though answers with absolute error of up to $10^{-4}$ are acceptable.

Example 

$arr=[1,1,0,-1,-1]$  

There are $n=5$ elements, two positive, two negative and one zero.  Their ratios are $\frac25=0.40000$, $\frac25=0.40000$ and $\frac15=0.200000$.  Results are printed as:  

0.400000
0.400000
0.200000

Function Description

Complete the plusMinus function in the editor below.

plusMinus has the following parameter(s):

int arr[n]: an array of integers

Print 

    Print the ratios of positive, negative and  zero values in the array.  Each value should be printed on a separate line with $6$ digits after the decimal.  The function should not return a value.  

Input Format

The first line contains an integer, $n$, the size of the array. 

The second line contains $n$ space-separated integers that describe $arr[n]$.

Constraints

$0 < n \leq100$ 

$-100\leq arr[i]\leq100$  

Output Format

Print the following $3$ lines, each to $6$ decimals:

proportion of positive values
proportion of negative values
proportion of zeros

Sample Input
STDIN           Function
-----           --------
6               arr[] size n = 6
-4 3 -9 0 4 1   arr = [-4, 3, -9, 0, 4, 1]

Sample Output
0.500000
0.333333
0.166667

Explanation

There are $3$ positive numbers, $2$ negative numbers, and $1$ zero in the array. 

The proportions of occurrence are positive:  $\frac{3}{6}=0.500000$, negative:  $\frac{2}{6}=0.333333$ and zeros:  $\frac{1}{6}=0.166667$.

Source: hackerrank | Difficulty: EASY


Solutions:
T = int(input())
lists = [int(_) for _ in input().split()]
p = 0
m = 0
z = 0
for ele in lists:
	if ele > 0:
		p += 1
	elif ele < 0:
		m += 1
	else:
		z += 1
p = p / T
m = m / T
z = z / T
round(p, 3)
round(m, 3)
round(z, 3)
print(p)
print(m)
print(z)


N = int(input())
listahan = input().split()
diks = {'pos': 0, 'neg': 0, 'zer': 0}
for i in listahan:
	if int(i) > 0:
		diks['pos'] += 1
	elif int(i) < 0:
		diks['neg'] += 1
	else:
		diks['zer'] += 1
print(format(diks['pos'] / N, '.3f'))
print(format(diks['neg'] / N, '.3f'))
print(format(diks['zer'] / N, '.3f'))


N = int(input())
somenums = input().strip().split(' ')
somenums = [int(x) for x in somenums]
(negs, zeros, pos, totalnums) = (0, 0, 0, len(somenums))
for i in range(N):
	if somenums[i] < 0:
		negs += 1
	elif somenums[i] == 0:
		zeros += 1
	else:
		pos += 1
print(round(pos / totalnums, 3))
print(round(negs / totalnums, 3))
print(round(zeros / totalnums, 3))


num = int(input())
l = [int(i) for i in input().split()]
p = 0
n = 0
z = 0
for i in l:
	if i > 0:
		p += 1
	elif i < 0:
		n += 1
	else:
		z += 1
print(p / len(l))
print(n / len(l))
print(z / len(l))


def plusminus(n):
	k = map(int, input().split())
	p = 0
	ne = 0
	z = 0
	for i in k:
		if i > 0:
			p += 1
		elif i == 0:
			z += 1
		elif i < 0:
			ne += 1
	print(round(p / n, 3))
	print(round(ne / n, 3))
	print(round(z / n, 3))
n = int(input())
plusminus(n)


n = int(input())
zeroes = 0
pluses = 0
nums = input().split()
for num in nums:
	if int(num) == 0:
		zeroes += 1
	elif int(num) > 0:
		pluses += 1
print(pluses / n)
print((n - pluses - zeroes) / n)
print(zeroes / n)


a = int(input())
x = list(map(int, input().split()))
positive = 0
negative = 0
zero = 0
for i in x:
	if i > 0:
		positive += 1
	elif i < 0:
		negative += 1
	else:
		zero += 1
print(positive / a)
print(negative / a)
print(zero / a)


N = int(input())
arr = map(int, input().split())
(z1, z2, z3) = (0, 0, 0)
for elem in arr:
	if elem > 0:
		z1 += 1
	elif elem < 0:
		z2 += 1
	else:
		z3 += 1
print('%.6f\n%.6f\n%.6f' % (z1 / N, z2 / N, z3 / N))


n = int(input())
n_plus = 0
n_minus = 0
n_zero = 0
for v in input().split():
	v = int(v)
	if v > 0:
		n_plus += 1
	elif v < 0:
		n_minus += 1
	else:
		n_zero += 1
n = float(n)
print(n_plus / n)
print(n_minus / n)
print(n_zero / n)


count = int(input())
nums = [int(x) for x in input().split()]
(pos, neg, zero) = (0, 0, 0)
pos = len([x for x in nums if x > 0])
neg = len([x for x in nums if x < 0])
zero = count - pos - neg
print(round(pos / count, 3))
print(round(neg / count, 3))
print(round(zero / count, 3))


t = int(input())
array = [int(i) for i in input().split()]
p = 0
n = 0
z = 0
for num in array:
	if num > 0:
		p += 1
	elif num < 0:
		n += 1
	else:
		z += 1
pf = float('{0:.3f}'.format(p / t))
nf = float('{0:.3f}'.format(n / t))
zf = float('{0:.3f}'.format(z / t))
print(pf)
print(nf)
print(zf)


size = int(input())
array = list(map(int, input().split()))
pos = 0
neg = 0
non = 0
for i in array:
	if i > 0:
		pos += 1
	elif i < 0:
		neg += 1
	else:
		non += 1
pos = pos / size
neg = neg / size
non = non / size
print('%.6f' % pos)
print('%.6f' % neg)
print('%.6f' % non)


n = int(input())
p = 0
neg = 0
zero = 0
b = list(map(int, input().split()))
for x in b:
	if x < 0:
		neg += 1
	elif x > 0:
		p += 1
	else:
		zero += 1
print('%0.3f\n%0.3f\n%0.3f' % (p / n, neg / n, zero / n))


N = int(input())
numbers = list(map(int, input().split()))
zeros = positive = negative = 0
for n in numbers:
	if n == 0:
		zeros += 1
	elif n > 0:
		positive += 1
	else:
		negative += 1
print(positive / N, negative / N, zeros / N, sep='\n')


from sys import stdin, stdout
l = int(stdin.readline())
array = stdin.readline()
pos = 0
neg = 0
zero = 0
for i in array.split(' '):
	i = int(i)
	if i > 0:
		pos += 1
	if i < 0:
		neg += 1
	if i == 0:
		zero += 1
print(pos / l)
print(neg / l)
print(zero / l)


import sys
count_pos = count_neg = count_zer = 0
n = int(sys.stdin.readline())
arr = list(map(int, sys.stdin.readline().split()))
for i in range(n):
	if arr[i] == 0:
		count_zer += 1
	elif arr[i] > 0:
		count_pos += 1
	else:
		count_neg += 1
print(count_pos / n)
print(count_neg / n)
print(count_zer / n)


n = int(input())
str = input()
list = []
i = 0
for i in range(n):
	list.append(int(str.split()[i]))
pos = 0
zero = 0
neg = 0
i = 0
for i in range(n):
	if list[i] > 0:
		pos += 1
	elif list[i] == 0:
		zero += 1
	else:
		neg += 1
print(pos / n)
print(neg / n)
print(zero / n)


x = c = 0
(sum1, sum2, sum3) = ([], [], [])
a = int(input())
v = a
b = input().split()
while a > a - a:
	c = int(b[x])
	if c > 0:
		sum1.append(c)
	elif c < 0:
		sum2.append(c)
	elif c == 0:
		sum3.append(c)
	a = a - 1
	x = x + 1
print(len(sum1) / v)
print(len(sum2) / v)
print(len(sum3) / v)


N = int(input())
Nnegs = 0
Nzeros = 0
numbers = list(map(int, input().split()))
for i in range(N):
	if numbers[i] < 0:
		Nnegs += 1
	elif numbers[i] == 0:
		Nzeros += 1
fracNeg = float(Nnegs) / float(N)
fracZero = float(Nzeros) / float(N)
fracPos = 1 - fracNeg - fracZero
print('{0:.3f}'.format(fracPos))
print('{0:.3f}'.format(fracNeg))
print('{0:.3f}'.format(fracZero))


array_size = int(input())
p = 0
n = 0
z = 0
lists = [int(_) for _ in input().split()]
for ele in lists:
	if ele > 0:
		p += 1
	elif ele < 0:
		n += 1
	else:
		z += 1
p = p / array_size
n = n / array_size
z = z / array_size
print(p)
print(n)
print(z)


def plusminus(input_array, size):
	positive_count = 0
	negative_count = 0
	zeroes_count = 0
	for i in range(size):
		if int(input_array[i]) < 0:
			negative_count += 1
		elif int(input_array[i]) > 0:
			positive_count += 1
		else:
			zeroes_count += 1
	positive_count = positive_count / size
	negative_count = negative_count / size
	zeroes_count = zeroes_count / size
	return (positive_count, negative_count, zeroes_count)
N = int(input())
input_array = input().split()
print('%.3f\n%.3f\n%.3f\n' % plusminus(input_array, N))


t = int(input())
n = ''.join(input()).split()
(a, b, c) = [0, 0, 0]
for z in range(t):
	if int(n[z]) > 0:
		a = a + 1
	elif int(n[z]) < 0:
		b = b + 1
	else:
		c = c + 1
print('%.3f' % float(a / t))
print('%.3f' % float(b / t))
print('%.3f' % float(c / t))


n = int(input())
a = list(map(int, list(input().split(' '))))
positives = len([x for x in a if x > 0])
negatives = len([x for x in a if x < 0])
zeroes = len([x for x in a if x == 0])
print('{:.3}'.format(float(positives / n)))
print('{:.3}'.format(float(negatives / n)))
print('{:.3}'.format(float(zeroes / n)))


n = int(input())
neg = 0
pos = 0
zero = 0
for i in input().split():
	if int(i) < 0:
		neg += 1
	elif int(i) > 0:
		pos += 1
	else:
		zero += 1
print(format(pos / n, '.6f'))
print(format(neg / n, '.6f'))
print(format(zero / n, '.6f'))


n = int(input())
num = [int(i) for i in input().split(' ')]
pos = 0
z = 0
neg = 0
for i in num:
	if i > 0:
		pos += 1
	if i == 0:
		z += 1
	if i < 0:
		neg += 1
print(pos / n)
print(neg / n)
print(z / n)


def printportion(n, t):
	print('{:.3f}'.format(n / t))
poscount = 0
negcount = 0
zerocount = 0
n = int(input())
for x in input().split():
	num = int(x)
	if num == 0:
		zerocount += 1
	elif num > 0:
		poscount += 1
	else:
		negcount += 1
total = zerocount + poscount + negcount
printportion(poscount, total)
printportion(negcount, total)
printportion(zerocount, total)


N = int(input())
nums = [int(x) for x in input().split()]
print('{:.3f}'.format(len([x for x in nums if x > 0]) / N))
print('{:.3f}'.format(len([x for x in nums if x < 0]) / N))
print('{:.3f}'.format(len([x for x in nums if x == 0]) / N))


def PercOutput(a, n):
	return round(a / n, 3)
n = int(input())
pos = 0
neg = 0
zer = 0
for i in input().split():
	val = int(i)
	if val > 0:
		pos += 1
	elif val < 0:
		neg += 1
	else:
		zer += 1
print(PercOutput(pos, n))
print(PercOutput(neg, n))
print(PercOutput(zer, n))


import sys

def get_positive(L):
	return len(list(filter(lambda x: x > 0, L)))

def get_negative(L):
	return len(list(filter(lambda x: x < 0, L)))

def get_zeroes(L):
	return L.count(0)

def main():
	sys.stdin.readline()
	L = list(map(int, sys.stdin.readline().strip().split()))
	p = get_positive(L) / len(L)
	n = get_negative(L) / len(L)
	z = get_zeroes(L) / len(L)
	output = '{:.3f}\n{:.3f}\n{:.3f}'
	print(output.format(p, n, z))
main()


n = int(input())
lis = list(map(int, input().split()))
a = len(list(filter(lambda x: x < 0, lis))) / n
b = len(list(filter(lambda x: x == 0, lis))) / n
c = len(list(filter(lambda x: x > 0, lis))) / n
print('%.3f' % c)
print('%.3f' % a)
print('%.3f' % b)


n = int(input())
pos = 0
zer = 0
neg = 0
data = input().split()
for i in range(0, n):
	if int(data[i]) > 0:
		pos += 1
	elif int(data[i]) == 0:
		zer += 1
	elif int(data[i]) < 0:
		neg += 1
fneg = neg / n
fzer = zer / n
fpos = pos / n
print(fpos)
print(fneg)
print(fzer)


t = int(input())
s = input()
r = list(s.split())
(p, n, z) = (0, 0, 0)
for i in range(0, t):
	if int(r[i]) > 0:
		p += 1
	elif int(r[i]) < 0:
		n += 1
	else:
		z += 1
print(format(p / t, '.3f'))
print(format(n / t, '.3f'))
print(format(z / t, '.3f'))


a = int(input())
b = [0, 0, 0]
for i in map(int, input().split()):
	if i:
		if i > 0:
			b[0] += 1
		else:
			b[1] += 1
	else:
		b[2] += 1
b = [i / a for i in b]
print('%.3f\n%.3f\n%.3f' % (b[0], b[1], b[2]))


import fileinput
input_list = []
for line in fileinput.input():
	L = [int(i) for i in line.split()]
	input_list.append(L)
N = input_list[0][0]
nega = 0
zero = 0
posi = 0
for x in range(N):
	if input_list[1][x] < 0:
		nega += 1
	elif input_list[1][x] == 0:
		zero += 1
	elif input_list[1][x] > 0:
		posi += 1
print('%.3f' % (posi / N))
print('%.3f' % (nega / N))
print('%.3f' % (zero / N))


n = int(input())
a = list(map(int, input().split()))
positive = 0
negative = 0
zeroes = 0
for i in a:
	if i > 0:
		positive += 1
	elif i == 0:
		zeroes += 1
	else:
		negative += 1
print(float(positive) / n)
print(float(negative) / n)
print(float(zeroes) / n)


a = int(input())
p = 0
n = 0
z = 0
d = input()
ln = d.strip().split()
for x in range(a):
	if int(ln[x]) > 0:
		p += 1
	elif int(ln[x]) == 0:
		z += 1
	else:
		n += 1
print(p / a)
print(n / a)
print(z / a)


from string import Formatter
input()
array = list(map(int, input().split()))
(p, n, z) = (0, 0, 0)
for ii in range(len(array)):
	if array[ii] > 0:
		p += 1
	elif array[ii] < 0:
		n += 1
	else:
		z += 1
print('{0:.3f}'.format(p / len(array)))
print('{0:.3f}'.format(n / len(array)))
print('{0:.3f}'.format(z / len(array)))


n = int(input())
a = input().split()
pos = neg = zero = 0
for i in range(0, n):
	k = int(a[i])
	if k > 0:
		pos += 1
	elif k < 0:
		neg += 1
	else:
		zero += 1
print('%.3f' % float(pos / n))
print('%.3f' % float(neg / n))
print('%.3f' % float(zero / n))


N = int(input())
A = [int(x) for x in input().split()]
positives = 0
negatives = 0
zeroes = 0
for i in A:
	if i > 0:
		positives += 1
	elif i < 0:
		negatives += 1
	else:
		zeroes += 1
print(round(positives / N, 3))
print(round(negatives / N, 3))
print(round(zeroes / N, 3))


import sys
arrayLength = sys.stdin.readline()
arrayLength = int(arrayLength)
array = sys.stdin.readline().split(' ')
numPos = numNeg = numZero = 0
for x in array:
	if int(x) > 0:
		numPos += 1
	elif int(x) < 0:
		numNeg += 1
	else:
		numZero += 1
print('{:.3f}\n{:.3f}\n{:.3f}'.format(float(numPos / arrayLength), float(numNeg / arrayLength), float(numZero / arrayLength)))


import sys

def main():
	numSize = int(sys.stdin.readline())
	numbers = sys.stdin.readline().split()
	numbers[:] = [int(x) for x in numbers]
	(negCount, posCount, zerCount) = (0, 0, 0)
	for i in numbers:
		if i > 0:
			negCount += 1
		elif i < 0:
			posCount += 1
		else:
			zerCount += 1
	print(negCount / numSize)
	print(posCount / numSize)
	print(zerCount / numSize)
main()


n = int(input())
m = []
a = input()
m.append(a.split())
countp = 0
countn = 0
countz = 0
for i in range(0, n):
	if int(m[0][i]) == 0:
		countz += 1
	elif int(m[0][i]) > 0:
		countp += 1
fracp = countp / n
fracz = countz / n
fracn = 1 - fracp - fracz
print(fracp)
print(fracn)
print(fracz)


n = int(input())
nums = input().split()
positive = 0
negative = 0
zeroes = 0
for num in nums:
	value = int(num)
	if value == 0:
		zeroes += 1
	elif value < 0:
		negative += 1
	else:
		positive += 1
print('%.3f' % (positive / n))
print('%.3f' % (negative / n))
print('%.3f' % (zeroes / n))


_ = input()
nums = [int(el) for el in input().split()]
print(len([num for num in nums if num > 0]) / len(nums))
print(len([num for num in nums if num < 0]) / len(nums))
print(nums.count(0) / len(nums))


n = int(input())
(pos, neg, zero) = (0, 0, 0)
for i in (int(x) for x in input().split(' ')):
	if i > 0:
		pos += 1
	elif i < 0:
		neg += 1
	else:
		zero += 1
print(pos / n)
print(neg / n)
print(zero / n)


n = int(input())
(pos, neg, zer) = (0, 0, 0)
l = [int(i) for i in input().split()]
for i in l:
	if i > 0:
		pos += 1
	elif i < 0:
		neg += 1
	else:
		zer += 1
print(round(pos / n, 6))
print(round(neg / n, 6))
print(round(zer / n, 6))


N = int(input())
numbers = [int(j) for j in input().split()]
pos = 0
neg = 0
zer = 0
for i in range(N):
	if numbers[i] > 0:
		pos += 1
	elif numbers[i] < 0:
		neg += 1
	else:
		zer += 1
print('%.3f\n%.3f\n%.3f' % (pos / N, neg / N, zer / N))


t = int(input())
l = []
while len(l) != t:
	l += [int(i) for i in input().split()]
(p, n) = (0, 0)
for i in l:
	if i > 0:
		p += 1
	elif i < 0:
		n += 1
print(p / t)
print(n / t)
print((t - p - n) / t)


N = int(input())
countp = 0
countn = 0
countz = 0
l = input()
nums = l.split(' ')
for i in range(0, N):
	if int(nums[i]) > 0:
		countp += 1
	elif int(nums[i]) < 0:
		countn += 1
	else:
		countz += 1
formatted = '{0:4.3f}'
print(formatted.format(countp / N))
print(formatted.format(countn / N))
print(formatted.format(countz / N))


total_count = int(input())
positive = 0
negative = 0
zeroes = 0
for i in map(int, input().split()):
	if i > 0:
		positive += 1
		continue
	if i < 0:
		negative += 1
		continue
	zeroes += 1
print('{0:3f}'.format(float(positive) / total_count))
print('{0:3f}'.format(float(negative) / total_count))
print('{0:3f}'.format(float(zeroes) / total_count))


neg = 0
pos = 0
zero = 0
n = int(input())
arr = list(map(int, input().split(' ')))
for num in arr:
	if num > 0:
		pos += 1
	elif num < 0:
		neg += 1
	elif num == 0:
		zero += 1
print(round(pos / n, 3))
print(round(neg / n, 3))
print(round(zero / n, 3))


N = int(input())
array = input().split()
zeroes = 0
positives = 0
negatives = 0
for item in array:
	if int(item) == 0:
		zeroes += 1
	elif int(item) < 0:
		negatives += 1
	elif int(item) > 0:
		positives += 1
print(positives / N)
print(negatives / N)
print(zeroes / N)


n = int(input())
row = [int(x) for x in input().split()]
pos = 0
neg = 0
zero = 0
size = len(row)
for nr in row:
	if nr > 0:
		pos += 1
	elif nr < 0:
		neg += 1
	elif nr == 0:
		zero += 1
print('{:.3f}'.format(pos / size))
print('{:.3f}'.format(neg / size))
print('{:.3f}'.format(zero / size))


def separatenumbers(line):
	raw = str(line).split(' ')
	return list(map(int, raw))

def count_number_types(line):
	pos = 0
	neg = 0
	zer = 0
	for i in line:
		if i > 0:
			pos += 1
		elif i < 0:
			neg += 1
		else:
			zer += 1
	return (pos, neg, zer)
total = input()
(pos, neg, zer) = count_number_types(separatenumbers(input()))
print(float(pos) / float(total))
print(float(neg) / float(total))
print(float(zer) / float(total))


n = int(input())
l = []
l = list(map(int, input().split()))
cntp = 0
cntz = 0
cntn = 0
for j in l:
	if j == 0:
		cntz += 1
	if j < 0:
		cntn += 1
cntp = len(l) - cntn - cntz
p = float('%0.3f' % (cntp / len(l)))
z = float('%0.3f' % (cntz / len(l)))
n = float('%0.3f' % (cntn / len(l)))
print(p)
print(n)
print(z)


k = [0] * 3
n = int(input())
a = list(map(int, input().split()))
for x in a:
	k[1 + (x > 0) - (x < 0)] += 1
for i in [2, 0, 1]:
	print(round(k[i] / n, 3))


length = int(input())
listInput = list(map(int, input().split()))
nPositive = int(0)
nNegative = int(0)
nZero = int(0)
for i in listInput:
	if i == 0:
		nZero = nZero + 1
	elif i > 0:
		nPositive = nPositive + 1
	elif i < 0:
		nNegative = nNegative + 1
print('%.3f' % (nPositive / length))
print('%.3f' % (nNegative / float(len(listInput))))
print('%.3f' % (nZero / float(len(listInput))))


n = int(input())
values = input().split(' ')
num_pos = 0
num_zero = 0
num_neg = 0
for val in values:
	val = int(val)
	if val < 0:
		num_neg += 1
	elif val > 0:
		num_pos += 1
	elif val == 0:
		num_zero += 1
print(u'{0:0.3f}'.format(num_pos / len(values)))
print(u'{0:0.3f}'.format(num_neg / len(values)))
print(u'{0:0.3f}'.format(num_zero / len(values)))


N = int(input())
n = list(map(int, input().split()))
a = 0
b = 0
z = 0
for i in n:
	if i == 0:
		z += 1
	if i > 0:
		a += 1
	if i < 0:
		b += 1
a = round(a / N, 3)
b = round(b / N, 3)
z = round(z / N, 3)
print(a)
print(b)
print(z)


def plus_minus(array):
	n = len(array)
	positive = 0
	negative = 0
	zeroes = 0
	for number in array:
		if number > 0:
			positive += 1
		elif number < 0:
			negative += 1
		else:
			zeroes += 1
	print('%.3f' % (positive / n))
	print('%.3f' % (negative / n))
	print('%.3f' % (zeroes / n))
n = int(input())
array = input().split(' ')
array = [int(number) for number in array]
plus_minus(array)


size = int(input())
int_list = [int(i) for i in input().split()]
tot = len(int_list)
pos = 0
neg = 0
zero = 0
for i in int_list:
	if i == 0:
		zero += 1
	elif i < 0:
		neg += 1
	else:
		pos += 1
print('{:.3f}'.format(pos / tot))
print('{:.3f}'.format(neg / tot))
print('{:.3f}'.format(zero / tot))


n = int(input())
positives = negatives = zeroes = 0
for i in [int(x) for x in input().split(' ')]:
	if i > 0:
		positives += 1
	elif i < 0:
		negatives += 1
	else:
		zeroes += 1
print('{:3f}'.format(positives / n))
print('{:3f}'.format(negatives / n))
print('{:3f}'.format(zeroes / n))


posCounter = 0
negCounter = 0
zedCounter = 0
n = int(input())
nums = list(map(int, input().split()))
for num in nums:
	if num > 0:
		posCounter += 1
	elif num < 0:
		negCounter += 1
	elif num == 0:
		zedCounter += 1
	else:
		print('Error in input number: ', num)
		exit()
print('{:.3f}'.format(posCounter / n))
print('{:.3f}'.format(negCounter / n))
print('{:.3f}'.format(zedCounter / n))


denominator = int(input())
test_strings = input()
signs = {'pos': 0, 'zer': 0, 'neg': 0}
active_test = []
active_test = test_strings.split()
for number in active_test:
	if int(number) > 0:
		signs['pos'] += 1
	elif int(number) < 0:
		signs['neg'] += 1
	else:
		signs['zer'] += 1
print(signs['pos'] / denominator)
print(signs['neg'] / denominator)
print(signs['zer'] / denominator)


n = int(input())
line = input()
line = list(map(int, line.split(' ')))
positives = list(filter(lambda x: x > 0, line))
negatives = list(filter(lambda x: x < 0, line))
zeroes = list(filter(lambda x: x == 0, line))
print('%0.3f' % (len(positives) / n))
print('%0.3f' % (len(negatives) / n))
print('%0.3f' % (len(zeroes) / n))


val = int(input())
arr = input().split(' ')
pos = 0
neg = 0
zero = 0
for i in arr:
	k = int(i)
	if k < 0:
		neg += 1
	elif k > 0:
		pos += 1
	else:
		zero += 1
print(pos / val)
print(neg / val)
print(zero / val)


x = []
size = int(input())
str = input()
x = str.split(' ')
for i in range(size):
	x[i] = int(x[i])
count1 = count2 = count3 = 0
for i in range(size):
	if x[i] < 0:
		count1 = count1 + 1
	elif x[i] > 0:
		count2 = count2 + 1
	else:
		count3 = count3 + 1
count1 = count1 / size
count2 = count2 / size
count3 = count3 / size
print('%.6f' % count2)
print('%.6f' % count1)
print('%.6f' % count3)


cnt = int(input())
lst = [int(x) for x in input().split()]
cnt_plus = len([int(x) for x in lst if x > 0])
cnt_minus = len([int(x) for x in lst if x < 0])
cnt_zero = len([int(x) for x in lst if x == 0])
print(cnt_plus / cnt)
print(cnt_minus / cnt)
print(cnt_zero / cnt)


t = int(input())
arr = list(map(int, input().split()))
pos = 0
neg = 0
zer = 0
for n in arr:
	if n < 0:
		neg += 1
	elif n > 0:
		pos += 1
	else:
		zer += 1
print(pos / t)
print(neg / t)
print(zer / t)


pos = 0
neg = 0
zer = 0
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	if a[i] > 0:
		pos += 1
	elif a[i] < 0:
		neg += 1
	else:
		zer += 1
print(round(pos / n, 3))
print(round(neg / n, 3))
print(round(zer / n, 3))


n = int(input())
nums = list(map(int, input().split(' ')))
posis = 0
negis = 0
zeros = 0
for i in nums:
	if i > 0:
		posis += 1
	if i < 0:
		negis += 1
	if i == 0:
		zeros += 1
print(posis / len(nums))
print(negis / len(nums))
print(zeros / len(nums))


total = int(input())
numbers = list(map(int, input().split(' ')))
plus = 0
minus = 0
zero = 0
for num in numbers:
	if num > 0:
		plus += 1
	elif num == 0:
		zero += 1
	else:
		minus += 1
print('%.3f' % (plus / total))
print('%.3f' % (minus / total))
print('%.3f' % (zero / total))


N = input()
N = float(N)
arr = []
pos = 0
neg = 0
zero = 0
m = input()
m = m.split()
for i in range(0, int(N)):
	k = int(m[i])
	if k > 0:
		pos = pos + 1
	elif k < 0:
		neg = neg + 1
	else:
		zero = zero + 1
pos = round(pos / N, 3)
neg = round(neg / N, 3)
zero = round(zero / N, 3)
print(pos)
print(neg)
print(zero)


N = int(input())
a = input().split(' ')
neg = 0
pos = 0
zer = 0
for i in range(0, N):
	if int(a[i]) > 0:
		pos += 1
	elif int(a[i]) < 0:
		neg += 1
	else:
		zer += 1
print(pos / N)
print(neg / N)
print(zer / N)


x = int(input())
inp = list(map(int, input().split(' ')))
(pos, neg) = (0, 0)
for i in range(x):
	if inp[i] > 0:
		pos = pos + 1
	elif inp[i] < 0:
		neg = neg + 1
zero = x - pos - neg
pos = pos / x
neg = neg / x
zero = zero / x
print('{0:.3f}\n{1:.3f}\n{2:.3f}'.format(pos, neg, zero))


n = int(int(input()))
a = [float(i) for i in input().split(' ')]
(p, m, z) = (0, 0, 0)
for x in a:
	if x < 0:
		m += 1
	elif x == 0:
		z += 1
	else:
		p += 1
print('%.4lf\n%.4lf\n%.4lf' % (p / n, m / n, z / n))


num_numbers = int(input())
numbers = []
list_numbers = input().split()
for num in range(num_numbers):
	numbers.append(int(list_numbers[num]))
greater_than_zero = 0
zero = 0
less_than_zero = 0
for i in numbers:
	if i > 0:
		greater_than_zero += 1
	elif i == 0:
		zero += 1
	else:
		less_than_zero += 1
print('{0:.3f}'.format(greater_than_zero / num_numbers))
print('{0:.3f}'.format(less_than_zero / num_numbers))
print('{0:.3f}'.format(zero / num_numbers))


def count_signs(ints):
	counts = [0, 0, 0]
	for i in ints:
		if i > 0:
			counts[0] += 1
		elif i < 0:
			counts[1] += 1
		else:
			counts[2] += 1
	return counts
	counts = {'pos': 0, 'neg': 0, 'zero': 0}
	for i in ints:
		if i > 0:
			counts['pos'] += 1
		elif i < 0:
			counts['neg'] += 1
		else:
			counts['zero'] += 1
	return counts

def get_proportion(counter):
	if type(counter) == {}:
		total = sum(counter.values())
		return ['{:.3f}'.format(sign / total) for sign in counter.values()]
	elif type(counter) == list:
		total = sum(counter)
		return ['{:.3f}'.format(sign / total) for sign in counter]

def main():
	N = int(input())
	ints = list(map(int, input().split(' ')))
	counter_dict = count_signs(ints)
	counts = get_proportion(counter_dict)
	print(*counts, sep='\n')
main()


n = int(input())
xs = [int(x) for x in input().split()]
print(len([x for x in xs if x > 0]) / len(xs))
print(len([x for x in xs if x < 0]) / len(xs))
print(len([x for x in xs if x == 0]) / len(xs))


N = int(input())
st = map(int, input().split())
plus = minus = zero = 0
for i in st:
	if i > 0:
		plus += 1
	elif i == 0:
		zero += 1
	else:
		minus += 1
print('{0:.3f}'.format(plus / N))
print('{0:.3f}'.format(minus / N))
print('{0:.3f}'.format(zero / N))


Len = int(input())
pos = 0
neg = 0
zer = 0
Arr = [int(n) for n in input().split()]
for i in range(0, Len):
	if Arr[i] > 0:
		pos = pos + 1
	elif Arr[i] < 0:
		neg = neg + 1
	elif Arr[i] == 0:
		zer = zer + 1
Pr = pos / Len
Nr = neg / Len
Zr = zer / Len
print(Pr)
print(Nr)
print(Zr)


num = int(input())
arr = list(map(int, input().split()))
(p, n, z) = (0, 0, 0)
for i in arr:
	if i > 0:
		p += 1
	elif i < 0:
		n += 1
	else:
		z += 1
print(p / num)
print(n / num)
print(z / num)


n = int(input())
t = []
k = []
a1 = 0.0
a2 = 0.0
a3 = 0.0
a = input()
t = a.split(' ')
for i in range(0, n):
	k.append(int(t[i]))
for m in range(0, n):
	if k[m] > 0:
		a1 = a1 + 1
	elif k[m] < 0:
		a2 = a2 + 1
	elif k[m] == 0:
		a3 = a3 + 1
print(a1 / n)
print(a2 / n)
print(a3 / n)


n = int(input())
nNumbers = input().split(' ')
plusCount = 0
minusCount = 0
zeroCount = 0
for each_number in nNumbers:
	if int(each_number) == 0:
		zeroCount = zeroCount + 1
	elif int(each_number) < 0:
		minusCount = minusCount + 1
	else:
		plusCount = plusCount + 1
plusFraction = plusCount / n
minusFraction = minusCount / n
zeroFraction = zeroCount / n
print('%.3f' % plusFraction)
print('%.3f' % minusFraction)
print('%.3f' % zeroFraction)


num_values = int(input())
values = [int(x) for x in input().split()]
three_dec_fmt = '{:.3f}'
num_positive = sum((1 for v in filter(lambda v: v > 0, values)))
print(three_dec_fmt.format(num_positive / num_values))
num_negative = sum((1 for v in filter(lambda v: v < 0, values)))
print(three_dec_fmt.format(num_negative / num_values))
num_zero = num_values - (num_positive + num_negative)
print(three_dec_fmt.format(num_zero / num_values))


neg = 0
pos = 0
zer = 0
tot = 0
input()
for i in [int(j) for j in input().split()]:
	tot += 1
	zer += i == 0
	pos += i > 0
	neg += i < 0
print('\n'.join((str(round(i / tot, 3)) for i in [pos, neg, zer])))


n = int(input())
pos = neg = 0
for x in map(int, input().split()):
	if x > 0:
		pos += 1
	elif x < 0:
		neg += 1
print(pos / n)
print(neg / n)
print((n - pos - neg) / n)


import decimal
n = int(input())
counter1 = 0
counter2 = 0
counter3 = 0
matrix = []
matrix = input().split()

def divideBy(num):
	return num / n
for i in range(n):
	if int(matrix[i]) > 0:
		counter1 += 1
	elif int(matrix[i]) == 0:
		counter2 += 1
	elif int(matrix[i]) < 0:
		counter3 += 1
print('{0:.4f}'.format(divideBy(counter1)))
print('{0:.4f}'.format(divideBy(counter3)))
print('{0:.4f}'.format(divideBy(counter2)))


count = int(input())
li = list(map(int, input().split()))
li = [a / abs(a) for a in li if a != 0] + [a for a in li if a == 0]
print(li.count(1) / count)
print(li.count(-1) / count)
print(li.count(0) / count)


n = int(input())
list1 = input().split()
count1 = 0
count2 = 0
count3 = 0
total = len(list1)
for x in list1:
	if int(x) > 0:
		count1 += 1
	elif int(x) < 0:
		count2 += 1
	else:
		count3 += 1
print(format(float(count1 / total), '.6f'))
print(format(float(count2 / total), '.6f'))
print(format(float(count3 / total), '.6f'))


import sys
sys.stdin.readline()
numbers = [int(elem) for elem in sys.stdin.readline().split()]
pos = sum((x > 0 for x in numbers))
neg = sum((x < 0 for x in numbers))
nil = sum((x == 0 for x in numbers))
total = len(numbers)
print('{0:.3f}'.format(pos / total))
print('{0:.3f}'.format(neg / total))
print('{0:.3f}'.format(nil / total))


t = int(input())
a = map(int, input().split())
p = n = z = 0.0
for i in a:
	if i < 0:
		n += 1
	elif i > 0:
		p += 1
	else:
		z += 1
print('%.3f\n%.3f\n%.3f' % (p / t, n / t, z / t))


def solve(numbers, n):
	pc = 0
	nc = 0
	zc = 0
	for n in numbers:
		if n > 0:
			pc += 1
		elif n < 0:
			nc += 1
		else:
			zc += 1
	tc = pc + nc + zc
	result = []
	result.append(float(pc) / tc)
	result.append(float(nc) / tc)
	result.append(float(zc) / tc)
	return result
n = int(input())
numbers = list(map(int, input().split()))
result = solve(numbers, n)
print(result[0])
print(result[1])
print(result[2])


count = int(input())
numbers = [int(n) for n in input().split()]
positives = len([n for n in numbers if n > 0])
negatives = len([n for n in numbers if n < 0])
print('{:f}'.format(positives / count))
print('{:f}'.format(negatives / count))
print('{:f}'.format((count - positives - negatives) / count))


n = int(input())
row = list(map(int, input().split()))
counter = {'positive': 0, 'negative': 0, 'zeros': 0}
for value in row:
	if value < 0:
		counter['negative'] += 1
	elif value > 0:
		counter['positive'] += 1
	else:
		counter['zeros'] += 1
print(str(counter['positive'] / len(row)))
print(str(counter['negative'] / len(row)))
print(str(counter['zeros'] / len(row)))