Problem G. permutation 2
时间限制 1000 ms
内存限制 256 MB
You are given three positive integers $N, x, y$.
Please calculate how many permutations of $1 \sim N$ satisfies the following conditions (We denote the $i$-th number of a permutation by $p_i$):
1. $p_1 = x$
2. $p_N = y$
3. for all $1 \le i <N$, $|p_i - p_{i+1}| \le 2$
输入数据
输出数据
For each test, output one integer in a single line indicating the answer modulo $998244353$.
样例输入
复制
3
4 1 4
4 2 4
100000 514 51144
样例输出
$ Mathjax font initiator $