#CCBCHBAHAI0000145. Dương, âm và bằng không (Plus Minus)
Dương, âm và bằng không (Plus Minus)
Plus Minus
Source: HackerRank
Version: Phuoc Hung OJ Extended
Problem Statement
Given an integer array , let , , and be the counts of positive, negative, and zero elements, respectively.
Compute the three ratios , , and .
Input
- The first line contains an integer .
- The second line contains integers .
Output
Print exactly three lines in this order:
- the ratio of positive elements;
- the ratio of negative elements;
- the ratio of zero elements.
Print each value with exactly digits after the decimal point. The judge accepts an absolute or relative error of at most .
Subtasks
Subtask 1 (100 points): and .
Examples
Input
6
-4 3 -9 0 4 1
Output
0.500000
0.333333
0.166667
Explanation
There are positive values, negative values, and zero. Their ratios are , , and .