1141 数的划分


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

将一个正整数划m分为n部分,即找一个正整数数列a1,...,an使得 a1+...+an=m 且a1<=a2<=...<=an。 当然,这样的数列有很多,我们把他们按照词典顺序排起来,你的任务是输出这些排好序的数列的第k个。 例如,m=9,n=4 这些数列有 1 1 1 6

1 1 2 5

1 1 3 4

1 2 2 4

1 2 3 3

2 2 2 3

第4个是1 2 2 4

Input

输入包括3行,分别是m,n,k (1<=n<= 10,1<= m<=220,k不会超过数列的数量,注意,k可能是一个很大的值)。

Output

输出一个数列,每个数之间用一个空格隔开。

Sample

Input

9
4
3

Output

1 1 3 4

Comments

There are no comments at the moment.