eolymp
bolt
Try our new interface for solving problems
Problems

New-year tree

New-year tree

For decoration of the New-year tree Peter has in the order a garland from the n lamps and k of different paints for their painting. How many methods can he to do it, if he must no two identical colors be alongside?

prb23

Input

The amount of lamps is n, the amount of different paints is k (1k, n15).

Output

Print the number of painting ways. If Peter can not paint a garland after the described requirements, to show out -1.

Time limit 1 second
Memory limit 64 MiB
Input example #1
6 2
Output example #1
2