Split Violins for Direct Comparison
Ironbark Manufacturing runs an A/B trial on a new tool holder: every station measures parts both with and without it. The chart splits each station's outline down the middle, one half per arm, so the two arms sit against a shared centre line instead of being drawn as separate shapes. The trial summary quotes the average across the whole treated arm.
Task: Print the average measurement across the treated arm.
Input
The first line holds one integer n, the number of measurements. Each of the next n lines holds a station name, an arm marker and one measurement, separated by single spaces. The arm marker is 0 for untreated or 1 for treated. Station names contain no spaces.
Output
One line with exactly two decimal places: the average of every measurement whose arm marker is 1, taken across all stations together rather than per station.
Example:
Input:
4
A 0 10
A 1 20
B 0 30
B 1 40
Output:
30.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