P8768 [Lanqiao Cup 2021 National A] Blocks.
Description
Xiao Lan has a large number of cubic blocks (all blocks are exactly the same). He plans to use them to build a huge shape.
To make it more stable, Xiao Lan lays all the blocks flat on the ground instead of stacking them. He arranges the blocks row by row, with all rows left-aligned. There are a total of $n$ rows, forming the final shape.
In the first row, Xiao Lan places $H_{1}=w$ blocks. Starting from the second row, the number of blocks $H_{i}$ in row $i$ is at least $L$ more than the previous row, and at most $R$ more than the previous row (when $L=0$, it means it can be the same as the previous row), i.e.
$$
H_{i-1}+L \leq H_{i} \leq H_{i-1}+R_{\circ}
$$
Given $x$, $y$, and $z$, among all plans that satisfy the conditions above, how many plans also satisfy that the number of blocks in row $y$ is exactly $z$ times the number of blocks in row $x$.
Input Format
One line contains $7$ integers $n, w, L, R, x, y, z$, with meanings as described above.
Output Format
Output one integer, representing the number of valid plans. The answer may be very large; output the remainder of the answer modulo $998244353$.
Explanation/Hint
**Sample Explanation**
The blocks that meet the conditions are shown in the figure below.

**Testdata Scale and Constraints**
For $10 \%$ of the testdata, $1 \leq n \leq 10, 1 \leq w \leq 10, 0 \leq L \leq R \leq 3$.
For $20 \%$ of the testdata, $1 \leq n \leq 20, 1 \leq w \leq 10, 0 \leq L \leq R \leq 4$.
For $35 \%$ of the testdata, $1 \leq n \leq 500, 0 \leq L \leq R \leq 10$.
For $50 \%$ of the testdata, $1 \leq n \leq 5000, 0 \leq L \leq R \leq 10$.
For $60 \%$ of the testdata, $1 \leq n \leq 20000, 0 \leq L \leq R \leq 10$.
For $70 \%$ of the testdata, $1 \leq n \leq 50000, 0 \leq L \leq R \leq 10$.
For $85 \%$ of the testdata, $1 \leq n \leq 3\times10^5, 0 \leq L \leq R \leq 10$.
For all testdata, $1 \leq n \leq 5\times10^5, 0 \leq w \leq 10^{9}, 0 \leq L \leq R \leq 40$, $1 \leq x