#C6463. Marble Probabilities

    ID: 50226 Type: Default 1000ms 256MiB

Marble Probabilities

Marble Probabilities

You are given a collection of marbles of different types. The number of types is given by an integer N, and a list of N integers is provided where each integer represents the number of marbles available of that type.

Your task is to compute the probability of drawing a marble of each type if one marble is selected at random. The probability for the i-th marble type is given by the formula:

\(P_i = \frac{c_i}{\sum_{j=1}^{N} c_j}\),

where \(c_i\) is the count of the i-th marble type. Output each probability rounded to 4 decimal places.

inputFormat

The input is read from standard input (stdin) and contains two lines:

  1. The first line contains an integer N, the number of different types of marbles.
  2. The second line contains N space-separated integers representing the count of marbles for each type.

outputFormat

Output a single line to standard output (stdout) containing N floating-point numbers each rounded to 4 decimal places, separated by a single space.

## sample
4
2 3 5 10
0.1000 0.1500 0.2500 0.5000