The Computer Game#376

The Computer Game

2 seconds
64 megabytes
Very hard

John and Brus are playing a military strategic game on the computer. The game is played on a flat world map. At the beginning of the game, Brus chooses positions for his army, and then John must choose strategic points for his army according to the following rules:

Two different lattice points (x_1, y_1) and (x_2, y_2) are connected if |x_1 - x_2| + |y_1 - y_2| = 1. If , , and are strategic points, and and are connected, and are connected, then and are also connected.

Input

The first line contains a single integer — the number of test cases. Each test case starts with a line containing two integers and separated by a single space. is the number mentioned in the first rule. is the number of lattice points on the map already occupied by Brus's army. Each of the next lines contains two integers X_k and Y_k separated by a space. Each point (X_k, Y_k) is occupied by Brus's army.

Output

For each test case, print a single line containing the number of ways John can choose strategic points for his army.

Constraints

1 \leq T \leq 74

1 \leq N \leq 7

1 \leq M \leq 225

-7 \leq X_k, Y_k \leq 7

All (X_k, Y_k) will be distinct.

Examples

Example 1

Loading
Loading