You have a square farm, divided into $n\times n$ cells. There are $m$ beautiful cells among all cells, whose locations are given. You would like to take some photos of the farm. A photo should figure a square area of the farm, with vertices located on grid points and edges parallel to the grid lines. What's more, its principal diagonal should lie on the principal diagonal of the whole farm.
You would like to take several photos so that each beautiful cell is contained in one photo. You hate repetitions so that any two of your photos should not coincide, that is, their common area is $0$. Each photo can contain an arbitrary number of beautiful cells, possibly $0$, $1$ or more. Count the number of set of photos satisfying the above conditions, modulo $998244353$.
In case you are confused, here we provide an illustration. The farm shown in this illustration is the same as the one in the sample test case.
![vSq3cj.png](https://s1.ax1x.com/2022/07/27/vSq3cj.png)
You are given $T$ independent test cases; solve each of them.