#K62512. Speed Limit Adjustment
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 , the adjusted speed is .
- If the speed value has two digits (i.e. ), the adjusted speed is the sum of its two digits.
- If the speed value has three or more digits (i.e. ), the adjusted speed is the last digit of the number (i.e. ).
Read the input from standard input and print your results to standard output.
inputFormat
The first line contains an integer , representing the number of test cases. The second line contains integers, each representing a speed value.
outputFormat
Print a single line with 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>