A Horizontal Box Plot
Thornhill Labs is comparing a dozen coating recipes at once. The boxes are drawn lying on their sides, because the recipe names are long and a label reading left to right fits where an upright one does not. What the report quotes for each recipe is the width of its box: how far the middle stretch of the batch reaches, ignoring the extremes at either end.
Task: Print the width of the box, which is the upper quarter mark minus the lower quarter mark. This lab pins those two marks with a deliberately blunt rule, so that anyone can check a figure by hand. With the readings in order and positions numbered from 0, the lower mark is the reading standing at position n // 4 and the upper mark is the reading at position 3 * n // 4, where // discards any remainder rather than rounding to the nearest position. Both marks are real readings, never values invented between two of them — which is not what a statistics textbook would hand you.
Input
The first line holds an integer n, the number of readings. Each of the next n lines holds one reading, possibly with decimals, in no particular order. n is at least 1.
Output
One line with exactly 1 digit after the decimal point.
Example:
Input:
8
1
2
3
4
5
6
7
8
Output:
4.0
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