Reading Off Each Group's Median From Raw Data
Thornhill Labs runs the same assay on three teams' equipment and draws all three batches as boxes on one axis. Comparing the middle lines by eye is the standard way to read such a chart, and it is exactly where readers go wrong: a box that sits higher overall can still have its middle line below a neighbour's. The report therefore names the winning team in words.
Task: Print A, B or C — whichever team has the highest middle result. A team's middle result is the reading in the centre once that team's readings are put in order, and every team always submits an odd number of readings. If two or more teams tie on the highest middle result, print whichever of them comes earliest in alphabetical order.
Input
Six lines. The first holds an integer and the second holds that many readings for team A, separated by single spaces. The third and fourth do the same for team B, the fifth and sixth for team C. Every count is odd and at least 1, and readings arrive in no particular order.
Output
One line holding a single capital letter, A, B or C.
Example:
Input:
3
10 20 30
3
50 60 70
3
1 2 3
Output:
B
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