#t476. 实习生分配

实习生分配

Assigning Interns

Problem Description

A factory has just hired nn interns. Now the nn interns must be assigned to mm workshops for their internship; multiple interns may go to the same workshop. How many different assignments are there?

Input Format

Two positive integers n,mn, m (0<n,m≤100 < n, m \le 10).

Output Format

One integer: the number of different assignments.

Sample Input

6 7

Sample Output

117649

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: it is really the same model as "arrangements with repetition" stated another way — each intern independently chooses a workshop, so the answer is mnm^n (here 76=1176497^6 = 117649).