409580: GYM103637 H Hockey championship

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

H. Hockey championshiptime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

The competition involves $$$2 \times n$$$ teams from $$$m$$$ countries. Teams are randomly matched into $$$n$$$ pairs. You know the expected value of the number of pairs in which both teams are from the same country. Find a possible country distribution of teams which has a given expected value.

Input

A single line contains two positive integers $$$x$$$ and $$$y$$$. The expected value is equal to $$$\frac{x}{y}$$$.

$$$$$$1 \le x, y \le 1000$$$$$$

Output

If there is no suitable distribution of teams by country, print in a single line "-1".

Otherwise, in the first line of the output file print one positive integer $$$m$$$ — the number of countries in which there are teams participating in the competition. In the second line print $$$m$$$ positive integer separated by a space — the number of teams in the corresponding country. The sum of the printed numbers has to be even and must not exceed $$$10^4$$$. It is guaranteed that if there is a suitable distribution, then there is a distribution that satisfies the given restrictions.

ExamplesInput
2 1
Output
1
4 
Input
1 2
Output
-1

加入题单

算法标签: