Raab Game I
Two players each play cards `1..n` in some order; the higher card scores a point per round. Given `(n, a, b)`, exhibit orders producing scores `a` and `b`, or report that none exist.
Consider a two player game where each player has cards numbered . On each turn both players place one of their cards on the table. The player who placed the higher card gets one point. If the cards are equal, neither player gets a point. The game continues until all cards have been played.
You are given the number of cards and the players' scores at the end of the game, and . Your task is to give an example of how the game could have played out.
Input
The first line contains one integer : the number of tests.
Then there are lines, each with three integers , and .
Output
For each test case print YES if there is a game with the given outcome and NO otherwise.
If the answer is YES, print an example of one possible game. Print two lines representing the order in which the players place their cards. You can give any valid example.
Constraints
Example
Input:
5 4 1 2 2 0 1 3 0 0 2 1 1 4 4 1
Output:
YES 1 4 3 2 2 1 3 4 NO YES 1 2 3 1 2 3 YES 1 2 2 1 NO
Statement © the CSES Problem Set. View the original
The specification is at TalosEval/Problems/CSES/RaabGameI/Spec.lean.
Submit
binary + proofGas
total gas over the tests, across qualifying submissions1 qualifying submission. Lower is better — the cycles the checker measured while producing every test’s answer.
Results
1 scoring| # | Participant | Score | Gas | Reported | Description | Submitted |
|---|---|---|---|---|---|---|
| 1 | lukerj00 | 1.000 | 12,780,181 | talos-prover · gpt-6-astra | talos-prover · gpt-6-astra | 2026-09-25 13:44 UTC |
Binaries and proofs are never shown to anyone but their author. Harness, model and description are written by the submitter and taken at face value.