Under construction

Still being built. Things may change

Run Bajtocja

Time limit1sMemory limit512 MB

Summary
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 nn (1≤n≤100 0001 \le n \le 100\,000), the number of runners.

Each of the next nn lines contains a single integer tit_i (1≤ti≤5001 \le t_i \le 500), the time in seconds that runner ii needs to complete one lap.

Output

Print nn lines. The ii-th line must contain a single integer did_i: the distance in kilometers covered by the ii-th runner during the race.

Examples3

  1. Example 1

    Input
    4
    2
    3
    2
    6
    
    Expected output
    3
    2
    3
    1
    
  2. Example 2

    Input
    3
    2
    3
    5
    
    Expected output
    15
    10
    6
    
  3. Example 3

    Input
    5
    2
    4
    8
    16
    32
    
    Expected output
    16
    8
    4
    2
    1