Edge Subsets

아직 제출이 없습니다시간 제한6초메모리 제한1024 MB

문제

You are given integers A,BA,B, and a simple undirected graph of NN vertices and MM edges. The vertices are numbered from 11 through NN, and the edges from 11 through MM. The edge ii connects the vertices U_iU\_i and V_iV\_i. Here, it is guaranteed that V_iU_i=AV\_i-U\_i=A or V_iU_i=BV\_i-U\_i=B.

Find the number of matchings of the graph, modulo 998244353998244353. Note that a matching of the graph is a subset of edges whose end-points are all distinct.

입력

The first line contains integers NN (3N2003 \leq N \leq 200), MM (1M4001 \leq M \leq 400), AA, and BB (1A<BN11 \leq A < B \leq N-1).

The following MM lines describe the edges. The ii-th of those lines contains integers U_iU\_i and V_iV\_i (1U_i<V_iN1 \leq U\_i < V\_i \leq N, V_iU_i=AV\_i-U\_i=A or V_iU_i=BV\_i-U\_i=B). There are no self-loops or multi-edges.

출력

Print the answer.