Problems
The Computer Game
The Computer Game
John and Brus are playing a military strategic game on a PC. The game is played on the flat world map. At the beginning of the game Brus places his army. Then John has to choose strategic points for his army according to the following rules:
\begin{itemize}
\item each strategic point must be a lattice point (\textbf{x}, \textbf{y}) (a lattice point is a point with integer coordinates) such that |\textbf{x}| + |\textbf{y}| < \textbf{N};
\item John can choose any positive number of strategic points;
\item all the strategic points must be distinct;
\item each of the strategic points must be free (i.e. not occupied by Brus’s army);
\item each pair of different strategic points must be connected (possibly via some other strategic points).
\end{itemize}
Here two different lattice points (\textbf{x_1, y_1}) and (\textbf{x_2, y_2}) are connected if |\textbf{x_1 -- x_2}| + |\textbf{y_1 -- y_2}| = \textbf{1}. If \textbf{A}, \textbf{B} and \textbf{C} are strategic points, \textbf{A} and \textbf{B} are connected, \textbf{B} and \textbf{C} are connected, then \textbf{A} and \textbf{C} are also connected.
Your task is to find the number of ways for John to choose strategic points for his army.
\InputFile
The first line contains single integer \textbf{T} -- the number of test cases. Each test case starts with a line containing two integers \textbf{N} and \textbf{M} separated by a single space. \textbf{N} is the number mentioned in the first rule. \textbf{M} is the number of lattice points on the world map already occupied by Brus’s army. Each of the following \textbf{M} lines contains two integers \textbf{X_k} and \textbf{Y_k} separated by a single space. Each lattice point (\textbf{X_k, Y_k}) is occupied by Brus’s army.
\OutputFile
For each test case print a single line containing the number of ways for John to choose strategic points for his army.
Constraints
\textbf{1} <= \textbf{T} <= \textbf{74},
\textbf{1} <= \textbf{N} <= \textbf{7},
\textbf{1} <= \textbf{M} <= \textbf{225},
\textbf{-7} <= \textbf{X_k, Y_k} <= \textbf{7},
all (\textbf{X_k, Y_k}) will be distinct.
Input example #1
2 2 1 7 7 2 3 0 0 4 -7 7 -4
Output example #1
20 4