#t332. 集合的划分(subset)

集合的划分(subset)

Set Partition (subset)

Problem Background

Special for beginners, ^_^

Problem Description

Let SS be a set with nn elements, S={a1,a2,…,an}S = \{a_1, a_2, \dots, a_n\}. Partition SS into kk subsets S1,S2,…,SkS_1, S_2, \dots, S_k satisfying the following conditions:

  1. Si≠ϕS_i \neq \phi
  2. $S_i \cap S_j = \phi\; (1 \le i, j \le k,\; i \neq j)$
  3. S1∪S2∪S3∪⋯∪Sk=SS_1 \cup S_2 \cup S_3 \cup \cdots \cup S_k = S

Then S1,S2,…,SkS_1, S_2, \dots, S_k is called a partition of SS. It is equivalent to placing the nn elements a1,a2,…,ana_1, a_2, \dots, a_n of SS into kk unlabeled boxes (0<k≤n<30)(0 < k \le n < 30) such that no box is empty.

Please determine the number of partitions S(n,k)S(n,k) of putting nn elements a1,a2,…,ana_1, a_2, \dots, a_n into kk unlabeled boxes.

Input Format

Input two integers nn and kk, both less than 30.

Output Format

Output an integer, the number of partitions.

Sample Input

23 7

Sample Output

4382641999117305

Constraints

Time limit: 1s, memory limit: 1024KiB for each test case.