Comparing Several Groups' Spread
Thornhill Labs is choosing between three suppliers of the same reagent. Consistency matters more than the headline figure here: a reagent that behaves the same way every time is worth more than one that averages slightly better and wanders. The three batches are drawn as three boxes side by side, which is what box plots are genuinely good at. The report has to name the least consistent supplier.
Task: Print A, B or C — whichever batch has the widest spread, where a batch's spread is its largest reading minus its smallest. If two or more batches tie on the widest spread, print whichever of them comes earliest in alphabetical order.
Input
Six lines. The first holds an integer n and the second holds n readings for batch A, separated by single spaces. The third and fourth do the same for batch B, the fifth and sixth for batch C. The three batches need not be the same size, and every batch holds at least one reading.
Output
One line holding a single capital letter: A, B or C.
Example:
Input:
3
10 20 30
2
5 6
3
1 50 2
Output:
C
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