#K33582. Dice Game Expected Score
Dice Game Expected Score
Dice Game Expected Score
In this problem, you are given a series of dice roll outcomes. Each outcome is an integer between 1 and 6. Each face value maps to a fixed score according to the following rules:
[ 1 \rightarrow 10, \quad 2 \rightarrow 2, \quad 3 \rightarrow 5, \quad 4 \rightarrow 8, \quad 5 \rightarrow -6, \quad 6 \rightarrow 0 ]
The expected score is defined as the average score over all dice rolls, i.e.,
[ \text{Expected Value} = \frac{\text{Total Score}}{\text{Number of Rolls}} ]
You are required to round the result to two decimal places.
For example, if the dice outcomes are: 1, 2, 3, 4, 5, 6 then the total score is (10+2+5+8+(-6)+0 = 19) and the expected value is (19/6 \approx 3.17).
inputFormat
The first line contains an integer (N), the number of dice rolls. The second line contains (N) space-separated integers representing the dice outcomes.
outputFormat
Print the expected score rounded to two decimal places.## sample
6
1 2 3 4 5 6
3.17