#include using namespace std; #define boost std::ios::sync_with_stdio(false);cin.tie(0);cout.tie(0) #define ll long long #define S second #define F first const ll mod = 1e9+7; int main() { boost; ll n,i,j,k,x; cin>>n>>k>>x; vector > dp(n); dp[1].F = (x==1)?0:1; dp[1].S = (x==1)?(k-1):(k-2); for(i=2 ; i