#CCBCHBAHAI0000143. Tỷ lệ đánh bóng (Batter Up)
Tỷ lệ đánh bóng (Batter Up)
Batter Up
Source: Kattis
Version: Phuoc Hung OJ Extended
Problem Statement
A player has plate appearances. Each value is encoded as follows:
0,1,2,3,4are the number of bases earned on an official at-bat;-1is a walk, which is excluded from both the numerator and the number of official at-bats.
The slugging percentage is the sum of bases from official at-bats divided by the number of official at-bats.
Compute the player's slugging percentage.
Input
- The first line contains an integer .
- The second line contains integers using the encoding above.
Output
Print the slugging percentage as a real number. The answer is accepted if its absolute or relative error does not exceed .
Subtasks
Subtask 1 (100 points): ; every ; at least one .
Examples
Input
3
1 -1 4
Output
2.5
Explanation
The -1 value is a walk and is ignored. The remaining two official at-bats earn and bases, for a total of bases over official at-bats. The slugging percentage is therefore .