Pedometer Distance
Time limit1sMemory limit256 MB
Multiply each step count by the stride length and print each distance in kilometres with five decimals.
- Level
Easy1 of 10
- Topics
- Implementation, Math
- Solved
- No attempts yet
Problem
A pedometer senses movement and counts steps fairly accurately. A step count alone is not a distance, so before using the device the owner measures her pace in centimetres and enters it. The pedometer multiplies the step count by the pace and shows how far she has walked.
You are given the pace and the step records of several pedometer users. Compute how far each record covers, in kilometres.
Input
The data for one user starts with the stride length , an integer in centimetres with . A value of ends the input and is not processed.
The next line holds , the number of records for this user, with . Then follow lines, each with the number of steps taken during one time period. Each step count is a positive integer no greater than .
Output
For each user, first print a line of this form.
User U
is the user number. Users are numbered from in the order they appear in the input.
Then print lines. Each line holds the distance walked for one record, in kilometres, in this form.
d.ddddd
That is at least one digit before the decimal point and exactly five digits after it. The distance is a whole number of centimetres divided by , so five digits represent it exactly and no rounding is needed.