Given an envelope, at most stamps are allowed to be pasted. Calculate how to design the face value of stamps so for the maximum value
where every postage between
and
can be obtained if given
(
) types of stamps (assuming there are infinitely many stamps of each type).
For example, ,
, if the face values are
cent and
cents, then every postage between
cents will be able to be obtained. Every postage between
cents can be obtained if the face values are
cent, and
cents, respectively. It can be proven that when
,
,
cents is the maximum continuous postage that can be obtained, so
and the face values are
cent and
cents respectively.
Input Specification
The input contains two integers, and
.
Output Specification
There should be two lines of output.
The first line of output should contain the face values chosen to maximize in increasing order.
Output MAX=S
on the second line, where represents the maximum postage that can be obtained.
Sample Input
3 2
Sample Output
1 3
MAX=7
Problem translated to English by .
Comments
On Luogu it says: "Unless you output the answer using a chart of all possible combinations and their corresponding answers, there is no guaranteed solution to this problem. The test data was too weak for this problem, and many incorrect solutions can pass the problem. AC does not mean your solution is correct. No hack data is accepted for this problem."