| SBC Brazilian Phase Zero 2025 |
|---|
| Finished |
An experiment at the Large Hadron Collider is being set up to test phase properties of various different particles. There are $$$N$$$ filters arranged in a circle, where the $$$i$$$-th filter allows particles with a phase less than or equal to its limit $$$A_i$$$ to pass.
An experiment begins with the release of a particle at the position of the $$$i$$$-th filter, with an initial phase set to $$$A_i$$$. When passing through filter $$$i$$$, including the first one, the particle:
We want to simulate the result of this experiment to compare with the results verified empirically. To achieve this, we need to create a vector $$$B_i$$$ of size $$$N$$$, where $$$B_i$$$ ($$$1 \leq B_i \leq N$$$) is the position of the filter that stopped the particle that started at position $$$i$$$.
The first line contains two integers $$$N$$$ ($$$1 \leq N \leq 2 \cdot 10^5$$$) and $$$K$$$ ($$$1 \leq K \leq 10^9$$$). The second line contains $$$N$$$ integers $$$A_1, A_2, \ldots, A_N$$$ ($$$-10^9 \leq A_i \leq 10^9$$$).
Print a line containing $$$N$$$ integers $$$B_1, B_2, \ldots, B_N$$$.
4 1 4 3 1 2
2 3 2 2
5 5 -10 -5 0 5 10
1 1 1 1 1
6 2 12 4 5 9 2 3
2 3 5 5 6 2
| Name |
|---|


