Run Bajtocja
Time limit1sMemory limit512 MB
Given each runner's lap time in seconds, compute how many 1 km laps each runner completes before all runners meet at the start again.
- Level
Medium4 of 10
- Topics
- Number theory, Math
- Solved
- No attempts yet
Problem
The King of Bajtocia wants his subjects to stay fit, so the capital regularly hosts a large running event called "Run Bajtocja". Crowds of citizens gather at the start line to begin the race.
The runners are not given a fixed distance to cover. Instead, they all set off together from a common start and keep running around a closed track that is exactly 1 km long, until the moment when every runner is back at the start point at the same time. Each runner would like to know how many kilometers they ran during the race. Because the race can last a very long time, the exhausted runners often lose count of how many laps they completed, even though each runner always covers one lap in the same, known amount of time.
Your task is to help each runner find out how far they ran.
Write a program that:
- reads, for each runner, the time it takes them to complete a single lap,
- computes, for each runner, how many kilometers they ran during the race,
- prints the results to standard output.
Input
The first line contains a single integer (), the number of runners.
Each of the next lines contains a single integer (), the time in seconds that runner needs to complete one lap.
Output
Print lines. The -th line must contain a single integer : the distance in kilometers covered by the -th runner during the race.