46. Speed in km/hr
Difficulty: easy · Math
Problem
A runner covers a distance of 1000 metres in `t` seconds. Compute the runner's speed in km/hr. Speed in m/s is `1000 / t`; multiply by `18/5` to convert to km/hr. Print the result rounded to 2 decimal places (exact halves round up).
Input
A single line containing the integer `t` (seconds).
Output
Print the speed in km/hr with exactly two digits after the decimal point.
Example 1
Input: 100 Output: 36.00
Explanation: 1000 m in 100 s is 10 m/s; 10 * 18/5 = 36 km/hr, printed as 36.00.
Example 2
Input: 7 Output: 514.29
Explanation: 3600 / 7 = 514.2857..., which rounds to 514.29.
Constraints
- 1 <= t <= 10^6
Solutions are judged against 2 sample and 10 hidden tests. Sign in to solve it · All problems