#P2089. 烤鸡
烤鸡
Description
Piggy Hanke especially likes eating roast chicken (we are both livestock—why cook each other so ruthlessly!). Hanke eats chicken in a special way. Why special? Because he has seasonings (mustard, cumin, etc.), and for each seasoning he can use to grams. The deliciousness of any roast chicken equals the sum of the masses of all seasonings.
Now Hanke wants to know: given a deliciousness , please output all combinations of these seasonings.
Input Format
A positive integer , representing the deliciousness.
Output Format
- On the first line, output the total number of solutions.
- From the second line to the end, output numbers per line, representing the mass used for each seasoning, in lexicographical order.
- If there is no valid method, output only a single on the first line.
11
10
1 1 1 1 1 1 1 1 1 2
1 1 1 1 1 1 1 1 2 1
1 1 1 1 1 1 1 2 1 1
1 1 1 1 1 1 2 1 1 1
1 1 1 1 1 2 1 1 1 1
1 1 1 1 2 1 1 1 1 1
1 1 1 2 1 1 1 1 1 1
1 1 2 1 1 1 1 1 1 1
1 2 1 1 1 1 1 1 1 1
2 1 1 1 1 1 1 1 1 1
Hint
For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号