CF1427F Boring Card Game
Description
When they are bored, Federico and Giada often play the following card game with a deck containing $ 6n $ cards.
Each card contains one number between $ 1 $ and $ 6n $ and each number appears on exactly one card. Initially the deck is sorted, so the first card contains the number $ 1 $ , the second card contains the number $ 2 $ , $ \dots $ , and the last one contains the number $ 6n $ .
Federico and Giada take turns, alternating; Federico starts.
In his turn, the player takes $ 3 $ contiguous cards from the deck and puts them in his pocket. The order of the cards remaining in the deck is not changed. They play until the deck is empty (after exactly $ 2n $ turns). At the end of the game both Federico and Giada have $ 3n $ cards in their pockets.
You are given the cards in Federico's pocket at the end of the game. Describe a sequence of moves that produces that set of cards in Federico's pocket.
Input Format
N/A
Output Format
N/A
Explanation/Hint
Explanation of the first testcase: Initially the deck has $ 12 = 2\cdot 6 $ sorted cards, so the deck is $ [1\ 2\ 3\ 4\ 5\ 6\ 7\ 8\ 9\ 10\ 11\ 12] $ .
- During turn $ 1 $ , Federico takes the three cards $ [9\ 10\ 11] $ . After his move, the deck is $ [1\ 2\ 3\ 4\ 5\ 6\ 7\ 8\ 12] $ .
- During turn $ 2 $ , Giada takes the three cards $ [6\ 7\ 8] $ . After her move, the deck is $ [1\ 2\ 3\ 4\ 5\ 12] $ .
- During turn $ 3 $ , Federico takes the three cards $ [2\ 3\ 4] $ . After his move, the deck is $ [1\ 5\ 12] $ .
- During turn $ 4 $ , Giada takes the three cards $ [1\ 5\ 12] $ . After her move, the deck is empty.
At the end of the game, the cards in Federico's pocket are $ [2\ 3\ 4\ 9\ 10\ 11] $ and the cards in Giada's pocket are $ [1\ 5\ 6\ 7\ 8\ 12] $ .