#include #include #include #include #define ll long long using namespace std; ll rec[1000] = {0}; int n, k, x; /* * Fibonacci Numbers using Dp */ ll rec_dp(int z) { rec[1] = 1; rec[2] = 1; if (rec[z-1] == 0) { for (int j = 3; j <= n; ++j) { if (rec[z] == 0){ rec[j] = (k-2) * rec[j - 1] + (k-1) * rec[j - 2]; } else continue; } } return rec[z-1]; } long long countArray(){ return rec_dp(n); } int main() { cin >> n >> k >> x; long long answer = countArray(); cout << answer << endl; return 0; }