#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; using ull = unsigned long long; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } //template T gcd(T a, T b) { a = abs(a), b = abs(b); while (b > 0) { tie(a, b) = make_pair(b, a % b); }return a; } //mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()); constexpr long long INF = 1LL << 60; constexpr int inf = 1000000007; //constexpr long long mod = 1000000007LL; constexpr long long mod = 998244353; struct mint { long long x; mint(long long x = 0) :x((x% mod + mod) % mod) {} mint& operator+=(const mint a) { if ((x += a.x) >= mod) x -= mod; return *this; } mint& operator-=(const mint a) { if ((x += mod - a.x) >= mod) x -= mod; return *this; } mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this; } mint operator+(const mint a) const { mint res(*this); return res += a; } mint operator-(const mint a) const { mint res(*this); return res -= a; } mint operator*(const mint a) const { mint res(*this); return res *= a; } mint pow(ll t) const { if (!t) return 1; mint a = pow(t >> 1); a *= a; if (t & 1) a *= *this; return a; } // for prime mod mint inv() const { return pow(mod - 2); } mint& operator/=(const mint a) { return (*this) *= a.inv(); } mint operator/(const mint a) const { mint res(*this); return res /= a; } }; const int MAX = (int)1e6; long long fac[MAX], finv[MAX], inv[MAX]; void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % mod; inv[i] = mod - inv[mod % i] * (mod / i) % mod; finv[i] = finv[i - 1] * inv[i] % mod; } } mint COM(int n, int k) { if (n < k) return 0; if (n < 0 || k < 0) return 0; return mint(fac[n] * (finv[k] * finv[n - k] % mod) % mod); } mint LCOM(ll n, ll k) { if (n < k) return 0; if (n < 0 || k < 0) return 0; if (k > n / 2) k = n - k; mint res = 1; for (int i = 0; i < k; i++) res *= (n - i); res *= finv[k]; return res; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); COMinit(); int n, m, L, K; cin >> n >> m >> L >> K; vector> cp(m + 2); for (int i = 1; i <= m; i++) cin >> cp[i].first >> cp[i].second; cp[m + 1] = { n,n }; vector> tg(L); for (auto& p : tg) cin >> p.first >> p.second; sort(tg.begin(), tg.end()); int tcur = 0; vector dp1(2, vector(L + 1)); int cur = 0; int nxt = 1; dp1[0][0] = 1; for (int i = 0; i + 1 < (int)cp.size(); i++) { vector> vp; vp.emplace_back(cp[i]); while (tcur < L and tg[tcur] <= cp[i + 1]) vp.emplace_back(tg[tcur++]); vp.emplace_back(cp[i + 1]); int sz = (int)vp.size(); vector dp2(sz, vector(sz + 1)); dp2[0][0] = 1; for (int j = 1; j < sz; j++) { for (int k = sz; k >= 0; k--) { for (int l = 0; l < j; l++) { int dx = vp[j].first - vp[l].first; int dy = vp[j].second - vp[l].second; if (dx < 0 or dy < 0) continue; if (j + 1 < sz and k > 0) dp2[j][k] += dp2[l][k - 1] * COM(dx + dy, dx); if (j + 1 == sz) dp2[j][k] += dp2[l][k] * COM(dx + dy, dx); } if ((j + 1 < sz and k > 0) or j + 1 == sz) for (int l = k + 1; l <= sz; l++) dp2[j][k] -= dp2[j][l]; } } for (int j = 0; j <= L; j++) dp1[nxt][j] = 0; for (int j = 0; j <= L; j++) { for (int k = 0; k <= sz; k++) { if (j + k <= L) { dp1[nxt][j + k] += dp1[cur][j] * dp2.back()[k]; } } } swap(cur, nxt); } mint res = 0; for (int i = 0; i <= min(L, K); i++) res += dp1[cur][i]; cout << res.x << "\n"; }