Pak Dengklek will play a magic trick. Pak Dengklek's assistant, Pak Ganesh, has N cards numbered from 1 to N. A spectator is invited to the stage to choose K distinct cards out of them and give them to Pak Ganesh. Pak Ganesh sees the card, then discards one of the K cards, then leaves the remaining K−1 cards in some order on the table. Pak Dengklek then looks at the K−1 cards on the table and must be able to determine the card discarded by Pak Ganesh.
Obviously, Pak Dengklek and Pak Ganesh must not communicate right after the trick is started, but they can determine their strategy before the trick is started. You must help them by designing their strategy. This time, Pak Dengklek and Pak Ganesh will play this trick Q times with the same value of N and K.
For each call to choose_cards:
For each call to find_discarded_card:
choose_cards in random order.