The pig family is going on a picnic during the holiday. However, Mr Bull and the constructors are constructing the road while they were traveling to the park. There are a total of $N$ workers, the 1-st worker is at the front of the road and the $N$-th worker is at the back. Given that the $i$-th worker will let go a car after every $C_i$ seconds. There are a total of $K$ cars, output the location of every car from the 1-st to the $T$-th second.
Simulation:
Input
The first line contains three integers, $N, K, T$.
The second line contains $N$ integers, where the $i$-th integer is $C_i$.
Output
Output the location of every car from the 1-st to the $T$-th second, in $T$ lines, following the format of the sample case.
Constraints
For all test cases: $1 \le N,K \le 100$, $1 \le T \le 10^4$, $1 \le C_i \le 10^3$
Subtask 1 (30%): $N = 1$
Subtask 2 (30%): $K = 1$
Subtask 3 (40%): No additional constraints
Sample Test Cases
Input | Output | |
---|---|---|
2 2 6 2 3 |
1: 2 2 2: 2 2 3: 1 2 4: 0 2 5: 0 2 6: 0 0 |
Scoring: Per Subtask
Authored by wy23493
Appeared in WYHK 2025 Mini Contest 0 [Session 2] and WYHK 2025 Mini Contest 0