| SMU ICPC Selection Contest 2026 |
|---|
| Finished |
At Britain's Got Talent 2026, Rafferty wants to perform a card trick using a deck of $$$n$$$ cards in a predetermined order.
Each card has:
The trick begins with all cards in the deck face-up.
from left to right.
Final result of the trick$$$^{1}$$$. The face-down letters of the cards at positions $$$i$$$ to $$$i+6$$$ spell BELIEVE when arranged in ascending order of face-up numbers. The BGT crowd goes wild — somehow, this is inspirational. In other words, for the chosen window of $$$7$$$ cards:
Your task is to construct the entire deck so that this works for every valid choice of $$$i$$$ ($$$1\leq i \leq n-6$$$).
$$$^{1}$$$ Watch the trick at https://www.youtube.com/watch?v=BCHkMexXu40&t=6m14s.
The input consists of a single line containing an integer $$$n$$$ ($$$n=7$$$ or $$$n=52$$$), the number of cards in the deck. There are exactly 2 tests for this problem. The sample has $$$n = 7$$$ and one hidden test case has $$$n=52$$$.
Output 2 lines:
Your output must satisfy all of the following:
7
7 5 4 3 2 1 6 E E I L E B V
The sample is only meant to illustrate the output format.
For $$$n=7$$$, the only valid choice is $$$i=1$$$. Sorting the $$$7$$$ cards by face-up number gives the numbers
$$$$$$ 1,2,3,4,5,6,7 $$$$$$
with corresponding letters
$$$$$$ \texttt{B},\texttt{E},\texttt{L},\texttt{I},\texttt{E},\texttt{V},\texttt{E} $$$$$$
so the word BELIEVE is formed.
Since there are only two possible inputs, you may output this exact construction for $$$n=7$$$ and focus on your construction for $$$n=52$$$.
| Name |
|---|


