Silver187 likes Permutation. For a permutation PP of length nn, a position x(2≤x≤n−1) is a good position if and only if P_xPi<Px, andPx>Px+1. In particular:
Silver187 wants to calculate the beauty value of a permutation PP of length nn. He defines a number SS, initially S=0S=0. Silver187 will repeat the following operations for the permutation PP until the permutation PP is in ascending order.
SS is the beautiful value of the permutation PP.
Silver187 gives you two numbers nn and mm. There are mm constraints. Every constraint will give xx and yy, which means the inital number of position xx is yy. Find the sum of the beauty values of all permutations that satisfy all constraints modulo 998244353.
The first line has one integer T(1≤T≤100), indicating there are T test cases.
In each case:
The first line contains two integers n(1≤n≤106), m(0≤m≤n)---the length of the permutation and the number of constraints.
The ii-th line of the next mm line contains two integers---the i-th constraint.
It is guaranteed that there is at least one permutation that satisfies all constraints.
Input guarantee 1≤∑m≤∑n≤107.
2
3 1
1 2
7 5
4 5
2 2
6 7
3 3
1 4
3
13