Marking the Mean on a Box Plot
Ironbark Manufacturing adds a second marker to each box for the average, alongside the line that shows the middle measurement. When the two markers sit apart, the measurements are lopsided — a few extreme parts are pulling the average away from where most parts actually are. The shift report prints both numbers so the gap can be seen without a chart.
Task: Print the average measurement and the middle measurement.
Input
The first line holds one integer n, the number of measurements. Each of the next n lines holds one measurement, a number on its own.
Output
One line holding two numbers separated by a single space: the average first, then the middle measurement. The middle is taken once the measurements are in order, averaging the two central ones on an even count. Each carries exactly two decimal places.
Example:
Input:
5
10
12
11
13
100
Output:
29.20 12.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