/* -*- coding: utf-8 -*- * * 2711.cc: No.2711 Connecting Lights - yukicoder */ #include #include using namespace std; /* constant */ const int MAX_N = 5; const int NBITS = 1 << MAX_N; const int MAX_M = 20000; const int MOD = 998244353; /* typedef */ /* global variables */ int bnums[NBITS], dp[MAX_M][NBITS]; /* subroutines */ inline void addmod(int &a, int b) { a = (a + b) % MOD; } /* main */ int main() { int n, m, k; scanf("%d%d%d", &n, &m, &k); int nbits = 1 << n; for (int bits = 1, msb = 1; bits < nbits; bits++) { if ((msb << 1) <= bits) msb <<= 1; bnums[bits] = bnums[bits ^ msb] + 1; } fill(dp[0], dp[0] + nbits, 1); for (int i = 0; i + 1 < m; i++) for (int bits0 = 0; bits0 < nbits; bits0++) if ((int)dp[i][bits0]) for (int bits1 = 0; bits1 < nbits; bits1++) if (bnums[bits0 & bits1] >= k) addmod(dp[i + 1][bits1], dp[i][bits0]); int sum = 0; for (int bits = 0; bits < nbits; bits++) addmod(sum, dp[m - 1][bits]); printf("%d\n", sum); return 0; }