Problem E
Pervasive Heart Monitor
You have been hired by a fitness center. You are helping to develop a system to monitor customer heart rate during exercise. While the customer stays in the gym, their heart rate is recorded at 10-minute intervals. When they leave, they can get a report of their average heart rate for the entire visit. Your job is to generate this report.
Input
Input consists of a series of lines, one for each customer.
Customers can scan their ID card when they enter or when they
leave, so each line has a customer name either at the start or
at the end. Other than the customer name, each line contains a
sequence of real values in the range
Output
For each customer in the order given in the input, print a line with the average of all their heart rate readings, followed by the name. The average heart rate should be accurate within 0.01 beats per minute.
Sample Input 1 | Sample Output 1 |
---|---|
Lisa Marie Presley 90.2 104.3 110.1 118.7 122.3 72.2 74 79.5 82.1 88.3 87.4 87.2 88.1 83.8 Bono |
109.120000 Lisa Marie Presley 82.511111 Bono |