P28697 [洛谷] Three Little Pigs
提高-
题目描述

Background

Have you heard the story of the Three Little Pigs? It's a classic tale. A long, long time ago, there were three little pigs. The first pig built a house with straw, the second pig built a house with sticks, and the third pig used bricks. A big bad wolf wanted to eat them and blew down the houses made of straw and sticks. However, the brick house was very sturdy, and the wolf couldn't destroy it. Eventually, the pigs defeated the wolf and burned its tail.

Problem Description

For their safety, the pigs built a new brick house. But now a problem arises: how to distribute the three pigs into two houses? The third pig, being the smartest of the three, considered three plans to avoid wasting any house, as shown in the figure below.

"But what about the future?" The third pig knows that as the number of members increases, they will build more houses. It wants to know how many ways there are to distribute the pigs into the houses given the number of pigs and houses, but this problem seems a bit too difficult for it. Can you help the pig solve this problem?

Input Format

The input file is piggy.in, which contains a single line with two integers n and m, representing the number of pigs and the number of rooms, respectively (1 ≤ n ≤ 50, 0 ≤ m ≤ 50).

Output Format

The output file is piggy.out, which contains a single integer representing the number of ways to place n pigs into m rooms without any room being empty.

Sample Input and Output

Sample Input #1

4 2

Sample Output #1

7

Sample Input #2

6 7

Sample Output #2

0
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
4 2
样例输出
7