#ifndef CLASS_MODINT #define CLASS_MODINT #include template class modint { private: std::uint32_t n; public: modint() : n(0) {}; modint(std::int64_t n_) : n((n_ >= 0 ? n_ : mod - (-n_) % mod) % mod) {}; static constexpr std::uint32_t get_mod() { return mod; } std::uint32_t get() const { return n; } bool operator==(const modint& m) const { return n == m.n; } bool operator!=(const modint& m) const { return n != m.n; } modint& operator+=(const modint& m) { n += m.n; n = (n < mod ? n : n - mod); return *this; } modint& operator-=(const modint& m) { n += mod - m.n; n = (n < mod ? n : n - mod); return *this; } modint& operator*=(const modint& m) { n = std::uint64_t(n) * m.n % mod; return *this; } modint operator+(const modint& m) const { return modint(*this) += m; } modint operator-(const modint& m) const { return modint(*this) -= m; } modint operator*(const modint& m) const { return modint(*this) *= m; } modint inv() const { return (*this).pow(mod - 2); } modint pow(std::uint64_t b) const { modint ans = 1, m = modint(*this); while (b) { if (b & 1) ans *= m; m *= m; b >>= 1; } return ans; } }; #endif // CLASS_MODINT #include #include using namespace std; using mint = modint<998244353>; vector > mul(int N, vector > A, vector > B) { vector > C(N, vector(N)); for (int i = 0; i < N; ++i) { for (int j = 0; j < N; ++j) { for (int k = 0; k < N; ++k) { C[i][k] += A[i][j] * B[j][k]; } } } return C; } int main() { int N, M, T; cin >> N >> M >> T; vector > G(N); for (int i = 0; i < M; ++i) { int a, b; cin >> a >> b; G[a].push_back(b); G[b].push_back(a); } vector dp(N); dp[0] = 1; for (int i = 0; i < T; ++i) { vector ndp(N); for (int j = 0; j < N; ++j) { for (int k : G[j]) { ndp[j] += dp[k]; } } dp = ndp; } cout << dp[0].get() << endl; return 0; }