#P3988. [SHOI2013] 发牌
[SHOI2013] 发牌
Description
In some poker games, such as Texas hold'em, dealing has its own rules. The professional dealer is commonly called the dealer. Before dealing, the dealer needs to burn a card (burn card). Burning means moving the current top card of the deck to the bottom of the deck. This helps prevent players from guessing cards and affecting the game.
Suppose at the start, the dealer takes out a new deck with distinct cards labeled from to . Since it is a new deck, the cards are in order from the top of the deck as , with card at the bottom. To deal all cards, the dealer performs dealing operations. Before the -th deal, he performs consecutive burn operations, where is given in the input. What is the final order of the cards received by the player?
For example, suppose . Initially, the deck order is .
- Suppose . The dealer burns twice, moves and to the bottom, then deals to the player. The current deck order is .
- Suppose . The dealer does not burn and directly deals to the player. The current deck order is .
- Suppose . The dealer burns in order, then deals to the player. The deck now has only one card left, .
- Suppose . After burning twice again, the dealer still deals to the player because is the only card in the deck.
Input Format
The first line contains an integer , the number of cards.
From the second line to line , the -th line contains an integer .
Output Format
Output lines. On the -th line, output one integer, the label of the -th card received by the player.
4
2
0
3
2
3
4
2
1
Hint
Constraints
For of the testdata, .
| Test point ID | Test point ID | ||
|---|---|---|---|
Translated by ChatGPT 5
京公网安备 11011102002149号