#K62512. Speed Limit Adjustment

    ID: 31548 Type: Default 1000ms 256MiB

Speed Limit Adjustment

Speed Limit Adjustment

You are given a number of test cases, each containing a speed value. Your task is to adjust the speed in accordance with the rules below:

  • If the speed value is less than 1010, the adjusted speed is 00.
  • If the speed value has two digits (i.e. 10N9910 \leq N \leq 99), the adjusted speed is the sum of its two digits.
  • If the speed value has three or more digits (i.e. N100N \geq 100), the adjusted speed is the last digit of the number (i.e. Nmod10N \mod 10).

Read the input from standard input and print your results to standard output.

inputFormat

The first line contains an integer TT, representing the number of test cases. The second line contains TT integers, each representing a speed value.

outputFormat

Print a single line with TT integers separated by spaces. Each integer is the adjusted speed for the corresponding test case, computed using the rules provided.## sample

3
0 5 9
0 0 0

</p>