Need Help regarding CSES Introductory problem RAAB GAME — 1

Правка en1, от ritchie_s, 2025-05-26 23:41:23

Consider a two player game where each player has n cards numbered 1,2,\dots,n. 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 n and the players' scores at the end of the game, a and b. Your task is to give an example of how the game could have played out.

Input The first line contains one integer t: the number of tests. Then there are t lines, each with three integers n, a and b.

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 1<=t<=1000 1<=n<=100 0<=a,b<=n

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

Could someone please help me with this problem , I cant seem to get around it.

Help will be much appreciated

Теги #cses

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский ritchie_s 2025-05-26 23:43:33 1097
en1 Английский ritchie_s 2025-05-26 23:41:23 1240 Initial revision (published)