This page is still under construction.

Parts of this page are still being built. What you see may change.

Pedometer Distance

Time limit1sMemory limit256 MB

Summary
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 LL, an integer in centimetres with 10<L<10010 < L < 100. A value of 00 ends the input and is not processed.

The next line holds NN, the number of records for this user, with 1≤N≤1001 \le N \le 100. Then follow NN lines, each with the number of steps taken during one time period. Each step count is a positive integer no greater than 2000020000.

Output

For each user, first print a line of this form.

User U

UU is the user number. Users are numbered from 11 in the order they appear in the input.

Then print NN 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 100000100000, so five digits represent it exactly and no rounding is needed.

Examples5

  1. Example 1

    Input
    58
    3
    10653
    8540
    12305
    46 
    2
    8500
    7945
    0
    
    Expected output
    User 1
    6.17874
    4.95320
    7.13690
    User 2
    3.91000
    3.65470
    
  2. Example 2

    Input
    11
    1
    1
    0
    
    Expected output
    User 1
    0.00011
    
  3. Example 3

    Input
    99
    1
    20000
    0
    
    Expected output
    User 1
    19.80000
    
  4. Example 4

    Input
    50
    3
    2000
    2000
    1
    0
    
    Expected output
    User 1
    1.00000
    1.00000
    0.00050
    
  5. Example 5

    Input
    11
    1
    20000
    99
    1
    1
    12
    1
    9999
    98
    1
    10000
    0
    
    Expected output
    User 1
    2.20000
    User 2
    0.00099
    User 3
    1.19988
    User 4
    9.80000