#P1021. [NOIP 1999 提高组] 邮票面值设计(疑似错题)
[NOIP 1999 提高组] 邮票面值设计(疑似错题)
Description
Given an envelope on which at most stamps may be affixed, determine, for given types of stamps (with and assuming an unlimited supply of each type), how to design the stamp denominations to obtain the largest value such that every postage value from to can be formed.
For example, when , : if the denominations are fen and fen, then every postage value between can be formed (and, of course, also , , and ); if the denominations are fen and fen, then every postage value between can be formed. One can verify that when and , is the largest consecutive postage value that can be obtained, so , with denominations fen and fen.
Input Format
Two integers, representing and .
Output Format
Output a total of lines.
On the first line, output the chosen denominations in ascending order.
On the second line, output MAX=S, where denotes the maximum consecutive postage value.
3 2
1 3
MAX=7
Hint
Translated by ChatGPT 5
京公网安备 11011102002149号