#P7427. [THUPC 2017] 玩游戏

[THUPC 2017] 玩游戏

Description

ljcc and his junior schoolmate are playing a game. The game has a total of nn rounds. Winning in the ii-th round gives ii 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 a,ba,b, 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 nn 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: a,b2311a,b\le 2^{31}-1, 1n1051\le n\le 10^5.

From THUPC (THU Programming Contest, Tsinghua University Programming Contest) 2017.

Translated by ChatGPT 5