def solve(n, ar):
    """
    Given an integer array ar of size n, return the decimal fraction of the
    number of positive numbers, negative numbers and zeroes. Test cases are
    scaled to 6 decimal places.
    """

    num_pos = 0
    num_neg = 0
    num_zero = 0

    for i in ar:
        if i > 0:
            num_pos += 1
        elif i < 0:
            num_neg += 1
        else:
            num_zero += 1

    # Return the ratios but cast to float to ensure preservation of precision.
    return (float(num_pos) / float(n),
            float(num_neg) / float(n),
            float(num_zero) / float(n))