Oh, Give Me a Home ------------------ Zeke wants to buy a new homestead. The area where homesteads are available is a rectangular area that is divided up into a grid of squares. There are N rows of squares and M columns of squares in the grid. Each square is either empty or blocked. Zeke's budget will allow him to buy four squares. The squares he chooses must form a contiguous region in the grid. (Thus, there must be a way to move from any one of Zeke's four squares to any other of his squares without leaving Zeke's property by a sequence of moves north, east, south or west.) You must compute the number of different ways that Zeke can choose the four squares to purchase. Example: .#. ... ##. (Where . represents an available square and # represents a blocked square) There are 4 ways Zeke can buy land: Z#. .#Z .#Z .#. ZZZ ZZZ .ZZ ZZZ ##. ##. ##Z ##Z Input ----- The first line of input is an integer T (T < 100) that gives you the number of test cases. Each case starts with a line containing 2 integers N and M (1 <= N,M <= 1000). N is the number of rows and M is the number of columns. The next line starts with an integer X that indicates how many squares are blocked. Following X (on the same line), we have X pairs of integers R1 C1 R2 C2 ... RX CX. Each pair Ri Ci gives the coordinates of one square that is blocked. (All pairs are distinct and inside the grid.) The top-left corner of the grid has coordinates (1,1) and the bottom right has coordinates (N,M). Output ------ For each case, output the solution as shown in the sample output. Sample Input ------------ 2 3 3 3 1 2 3 1 3 2 4 4 1 2 3 Sample Output ------------- Case 1: 4 Case 2: 63