Exploding Every Slice a Little
For a client's annual report, Calder & Voss pulls every wedge out by the same small amount, so the circle reads as a set of separated pieces rather than a solid disc. Because the shift is identical everywhere, no category is singled out — unlike the version where one wedge alone is pulled clear. The caption under it gives the typical size of a category, which is the number the report's copy is built around.
Task: Print the average value across all the categories.
Input
The first line holds an integer n, the number of categories. Each of the next n lines holds a category name, one word with no spaces, then its value, separated by a single space. Values may have decimals. n is at least 1.
Output
One line with exactly 2 digits after the decimal point. An average of twenty prints as 20.00.
Example:
Input:
3
A 10
B 20
C 30
Output:
20.00
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in