A rectangular cake with a grid of m × n unit squares on its top needs to be sliced into pieces. Several cherries are scattered on the top of the cake with at most one cherry on a unit square. The slicing should follow the rules below:
2/2 Input The input file contains multiple test cases. For each test case: The first line contains three integers, n, m and k (1 ≤ n,m ≤ 20), where n × m is the size of the grid on the cake, and k is the number of the cherries. Then k lines follow. Each line has two integers indicating the position of the unit square with a cherry on it. The two integers show respectively the row number and the column number of the unit square in the grid. All integers in each line should be separated by blanks. Output Output an integer indicating the least total length of the cutting edges. Sample Input 343 12 23 32 Sample Output Case 1: 5