| UDESC Selection Contest 2025-1 |
|---|
| Finished |
John Wick Fröhlich has finally managed to escape the mysterious labyrinth, but as he moved away, he realized he had dropped his navigation compass — a vital item — exactly in the central corridor, a narrow passage that is slowly closing. Now, he needs to be away for exactly $$$K$$$ seconds to retrieve the artifact and return before the passage becomes impassable.
The corridor is bounded by two walls, represented by the character "#". Between them, there are indestructible stones (character "o") and empty spaces (character "."), which were already part of the labyrinth.
Each second, the left wall advances one position to the right, immediately pushing any stone (o) that is in the space ahead.
Pushed stones can, in turn, push other stones in a chain reaction, but they are never destroyed or overlapped. The walls are also indestructible and cannot be overlapped.
Before setting out, John Fröhlich wants to know what the configuration of the corridor will look like after exactly $$$K$$$ seconds of wall movement, to ensure he can return safely.
The first line contains two integers $$$N$$$ and $$$K$$$ $$$(3 \le N \le 500$$$, $$$0 \le K \le 500)$$$ — the initial length of the corridor and the amount of time in seconds John Fröhlich will be away.
The second line contains a string of length $$$N$$$, composed of:
Print a single line with the string of length $$$N$$$ representing the state of the corridor after $$$K$$$ seconds of movement.
8 3#o..o.o#
...#ooo#
6 3#....#
...#.#
6 2#oooo#
#oooo#
13 4#...o..o.ooo#
....#o.o.ooo#
| Name |
|---|


