#P1025. [NOIP 2001 提高组] 数的划分

[NOIP 2001 提高组] 数的划分

Description

Partition the integer nn into kk non-empty parts, and regard two partitions as the same if they differ only in order.

For example, when n=7n=7, k=3k=3, the following three partitions are considered the same: 1,1,51, 1, 5;
1,5,11, 5, 1;
5,1,15, 1, 1.

How many different partitions are there?

Input Format

Two integers nn and kk.

Constraints: 6<n2006 < n \le 200, 2k62 \le k \le 6.

Output Format

One integer: the number of different partitions.

7 3

4

Hint

There are four partitions when n=7n=7, k=3k=3:
1,1,51, 1, 5;
1,2,41, 2, 4;
1,3,31, 3, 3;
2,2,32, 2, 3.

Problem Source: NOIP 2001 Senior, Problem 2.

Translated by ChatGPT 5