#P7255. [BalticOI 2012] 俄罗斯方块 (Day2)
[BalticOI 2012] 俄罗斯方块 (Day2)
Problem Description
This is a game similar to Tetris. There are the following pieces in the game:

The game has a area. For each falling piece, you may choose the column where the leftmost block of this piece (the marked block in the picture) will fall. If the piece does not fit completely inside the area, the game ends. At that moment, if there is any row that is completely filled with blocks, all blocks in that row will be cleared, and the blocks above will move down accordingly.
There are pieces in total. You need to make as many pieces as possible fall successfully.
Note that in this game the pieces cannot be rotated.
Input Format
Please download the input file from the attachment.
The first line contains an integer , meaning there are pieces in the game.
The next lines each contain an integer, representing the index of the falling piece.
The testdata guarantees that a solution exists.
Output Format
For the input file, please submit the corresponding output file.
The output file contains at most lines. Each line contains an integer, indicating the column index where the leftmost block of that falling piece lands.
Hint
[Hint]
Each test point is worth points.
If you can make pieces fall normally, then you can get a score of for that test point.
[Note]
Translated from BalticOI 2012 Day2 T3. Tiny.
Translated by ChatGPT 5