Yuanyuan Long is a dragon like this picture?I don’t know, maybe you can ask him. But I’m sureYuanyuan Long likes ballons, he has a lot of ballons. One day, he gets n white ballons and k kinds of pigment, and he thought a problem: 1. Number these ballons b1, b2, …, to bn. 2. Link these ballons to a circle in order, and color these ballons. 3. He need to make sure that any neighbor ballons have different colors. He wants to know how many solutions to solve this problem. Can you get the answer to him?The answer maybe very large, get the answer MOD 100000007. For Example: with 3 ballons and 3 kinds of pigment Your answer is 3*2*1 MOD 100000007 = 6. The answer maybe large, you can use integer type long long.
Yuanyuan Long is a dragon like this picture? I don’t know, maybe you can ask him. But I’m sure Yuanyuan Long likes ballons, he has a lot of ballons. One day, he gets n white ballons and k kinds of pigment, and he thought a problem: 1. Number these ballons b1, b2, … , bi, …, to bn. 2. Link these ballons to a circle in order, and color these ballons. 3. He need to make sure that any neighbor ballons have different colors. He wants to know how many solutions to solve this problem. Can you get the answer to him? The answer maybe very large, get the answer MOD 100000007. For Example: with 3 ballons and 3 kinds of pigment Your answer is 3*2*1 MOD 100000007 = 6. The answer maybe large, you can use integer type long long.