#t477. 我爱读书
我爱读书
I Love Reading
Problem Description
Teacher Shi distributes distinct books evenly among students numbered . How many different ways are there to do this?
Input Format
One line: an integer ().
Output Format
One line: an integer, the correct answer to the problem.
Sample Input
3
Sample Output
90
Hint
📚 Topic tag: this problem belongs to the combinatorial counting topic. It is not a loop problem and is placed here as optional material. If you have just started learning loops, feel free to skip it and come back when you have spare time.
Hint: the idea of "multiplying step by step" is already laid out in the hint area; just keep multiplying the binomial coefficients.
Distributing 6 distinct books to 3 students can be split into three stages:
- There are ways to choose the books for the first student;
- There are ways to choose the books for the second student;
- There are ways to choose the books for the third student.
In total there are $C_6^2\times C_4^2\times C_2^2=15\times 6\times 1=90$ ways.