#t478. 放球入盒
放球入盒
Balls into Boxes
Problem Description
Teacher Yang places identical balls into distinct boxes; a box may be empty. How many different ways are there to distribute the balls?
Input Format
One line, two integers ().
Output Format
One line, one integer: the correct answer to the problem.
Sample Input
7 4
Sample Output
120
Hint
- Topic tag: this problem belongs to the combinatorial counting topic, not a loop exercise — treat it as optional enrichment. Beginners practising loops can safely skip it and come back later.
- Hint: the balls are completely identical — try the "stars and bars" method. The answer is (here ).