#P7427. [THUPC 2017] 玩游戏
[THUPC 2017] 玩游戏
Description
ljcc and his junior schoolmate are playing a game. The game has a total of rounds. Winning in the -th round gives points. There are no draws.
Now you are given the scores of ljcc and the schoolmate. Determine whether there exists a valid plan that matches the current scores.
Input Format
Read from standard input.
Input one line with two integers , representing the scores of ljcc and the schoolmate.
Output Format
Write to standard output.
If there is a solution, output one valid solution in one line. The first number represents that the game has played a total of rounds. Then output several numbers indicating in which rounds ljcc won. Separate every two numbers by a single space, and there must be no trailing spaces at the end of the line. If there is no valid solution, output No.
10 5
5 1 2 3 4
Hint
Due to SPJ issues, it is forbidden to output trailing spaces or extra newlines.
Constraints: , .
Copyright Information
From THUPC (THU Programming Contest, Tsinghua University Programming Contest) 2017.
Translated by ChatGPT 5
京公网安备 11011102002149号