1886: Prizes For Coders

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:0 解决:0

题目描述

To hold the annual algorithm competition and encourage the hopeful young coders to take themselves into the match, Hedy has prepared n surprised prizes for them. Unfortunately, there are only m(m<n) boxes for the prizes. Hedy has to put the prizes into the boxes. But there are some conditions. First, none of the m boxes is allowed to be empty. Second, the number of box[i] is not less than box[i-1](1<=i<m). Third, for any positive number not greater than n, it must be ensured that sum of some boxes equals to the number. So, the smart coders, can you print the total ways in increased sequences. A sequence is larger than the other sequence if for i (1<=i<m),p[0]=q[0],p[1]=q[1]…p[i-1]=q[i-1] but p[i]>q[i];

输入

There are multiple cases. Each case contains two numbers n and m. n is the number of prizes and m is the number of boxes. 2 <= n <= 21 1 <= m <= 20 && m<n

输出

Print the sequences in increased order. One sequence per line. If it is impossible to arrange the beads, output "There is no answer" without quotes.

样例输入 复制

5 3
4 2

样例输出 复制

1 1 3
1 2 2
There is no answer