1822: 【CSP数组】邮票组合█

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:10 Solved:2

Description

某人有 lns="http://www.w3.org/1998/Math/MathML">m 张 lns="http://www.w3.org/1998/Math/MathML">3 分的邮票和 lns="http://www.w3.org/1998/Math/MathML">n 张 lns="http://www.w3.org/1998/Math/MathML">5 分的邮票,用这些邮票中的一张或若干张(也可以是 lns="http://www.w3.org/1998/Math/MathML">0 张)可以得到多少种不同的大于 lns="http://www.w3.org/1998/Math/MathML">0 的邮资?

请找出可能组合的邮资方案总数,并按照由小到大的顺序输出所有不重复的大于 lns="http://www.w3.org/1998/Math/MathML">0 的方案!

如:lns="http://www.w3.org/1998/Math/MathML">1 张 lns="http://www.w3.org/1998/Math/MathML">3 分和 lns="http://www.w3.org/1998/Math/MathML">1 张 lns="http://www.w3.org/1998/Math/MathML">5 分可能的邮资组合如下

lns="http://www.w3.org/1998/Math/MathML">0 张 lns="http://www.w3.org/1998/Math/MathML">3 分 lns="http://www.w3.org/1998/Math/MathML">+ lns="http://www.w3.org/1998/Math/MathML">1 张 lns="http://www.w3.org/1998/Math/MathML">5 分 lns="http://www.w3.org/1998/Math/MathML">= lns="http://www.w3.org/1998/Math/MathML">5 分

lns="http://www.w3.org/1998/Math/MathML">1 张 lns="http://www.w3.org/1998/Math/MathML">3 分 lns="http://www.w3.org/1998/Math/MathML">+ lns="http://www.w3.org/1998/Math/MathML">0 张 lns="http://www.w3.org/1998/Math/MathML">5 分 lns="http://www.w3.org/1998/Math/MathML">= lns="http://www.w3.org/1998/Math/MathML">3 分

lns="http://www.w3.org/1998/Math/MathML">1 张 lns="http://www.w3.org/1998/Math/MathML">3 分 lns="http://www.w3.org/1998/Math/MathML">+ lns="http://www.w3.org/1998/Math/MathML">1 张 lns="http://www.w3.org/1998/Math/MathML">5 分 lns="http://www.w3.org/1998/Math/MathML">= lns="http://www.w3.org/1998/Math/MathML">8 分

因此,可能的方案有 lns="http://www.w3.org/1998/Math/MathML">3 种,排序后的结果是:lns="http://www.w3.org/1998/Math/MathML">3 lns="http://www.w3.org/1998/Math/MathML">5 lns="http://www.w3.org/1998/Math/MathML">8 。

Input

两个整数,lns="http://www.w3.org/1998/Math/MathML">m  lns="http://www.w3.org/1998/Math/MathML">n ,分别代表了 lns="http://www.w3.org/1998/Math/MathML">3 分和 lns="http://www.w3.org/1998/Math/MathML">5 分的邮票的数量!(lns="http://www.w3.org/1998/Math/MathML">1m,n1000

Output

输出有两行,第一行输出这两种邮票能组合的不同的大于 lns="http://www.w3.org/1998/Math/MathML">0 的邮资方案,数与数之间用空格隔开。

第二行输出可能的方案总数。

Sample Input Copy

2 2

Sample Output Copy

3 5 6 8 10 11 13 16
8