Bins and balls
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
There are boxes arranged in a row. You have an unlimited supply of balls in different colors. Place one ball in each box in such a way that no two adjacent boxes contain balls of the same color. How many different arrangements of balls in the boxes are possible?
Input
One integer .
Output
Print the number of different arrangements of balls in the boxes, computed modulo .
Examples
Input #1
Answer #1
Submissions 5K
Acceptance rate 29%