Snezhik Sugrobovich put a row of
N Christmas balls in order to color them. He decided that each ball would be one of
K colors. At the same time, Snezhik Sugrobovich wants any two adjacent Christmas tree balls & nbsp; were painted in different colors. Find the number of possible ways to color the Christmas balls.
Input
The input string contains two integers
N and
K (
\(1<=N<=1000\),
\(2<=K<=1000\)).
Imprint
Display the answer to the problem. It is guaranteed that the correct answer does not exceed
\(2^{31}-1\).
Examples
| # |
Input |
Output |
| 1 |
2 2 |
2 |
| 1 |
1 10 |
10 |