#P1655. 小朋友的球

小朋友的球

Description

A kid recently became very fond of balls. One day, he took NN distinct balls out of his pocket and wants to put them into MM identical boxes, with at least one ball in each box. He wonders how many ways there are. He tried to write a program, but since he slacks off and only watches swimming coaches on Bilibili, he asks you for help.

Input Format

Multiple test cases. Each line contains two integers N,MN, M.

Output Format

For each test case, output a single line with the number of ways.

4 2
1 1
7
1

Hint

  • For 20%20\% of the testdata, N,M10N, M \leq 10.
  • For 100%100\% of the testdata, 1N,M1001 \leq N, M \leq 100, and there are at most 1010 test cases per test file.

Translated by ChatGPT 5