2017-02-12 00:31:12 -08:00
|
|
|
// Author: Rodney Shaghoulian
|
2018-07-27 16:45:56 -07:00
|
|
|
// Github: github.com/RodneyShag
|
|
|
|
|
// HackerRank: hackerrank.com/RodneyShag
|
2017-02-12 00:31:12 -08:00
|
|
|
|
2017-02-10 20:06:36 -08:00
|
|
|
import java.util.Scanner;
|
|
|
|
|
|
2017-03-10 01:10:37 -06:00
|
|
|
// Runtime: O(n)
|
|
|
|
|
// Space Complexity: O(1)
|
2017-02-10 20:06:36 -08:00
|
|
|
public class Solution {
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
Scanner scan = new Scanner(System.in);
|
|
|
|
|
int size = scan.nextInt();
|
|
|
|
|
|
|
|
|
|
double positives = 0;
|
|
|
|
|
double negatives = 0;
|
|
|
|
|
double zeroes = 0;
|
|
|
|
|
for (int i = 0; i < size; i++) {
|
|
|
|
|
int value = scan.nextInt();
|
|
|
|
|
if (value > 0) {
|
|
|
|
|
positives++;
|
|
|
|
|
} else if (value < 0) {
|
|
|
|
|
negatives++;
|
|
|
|
|
} else {
|
|
|
|
|
zeroes++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
scan.close();
|
|
|
|
|
|
|
|
|
|
System.out.println(positives / size);
|
|
|
|
|
System.out.println(negatives / size);
|
|
|
|
|
System.out.println(zeroes / size);
|
|
|
|
|
}
|
|
|
|
|
}
|