// Match the car in chess with binary matching # include <stdio. h> # include <algorithm> # include <string. h> using namespace STD; int n, m, PP [110] [110], map [110], vis [110]; int BFS (int x) {for (INT I = 1; I <= m; I ++) {If (! Vis [I] & PP [x] [I]) {vis [I] = 1; if (! Map [I] | BFS (Map [I]) {map [I] = x; return 1 ;}} return 0 ;}int F () {int A = 0; memset (MAP, 0, sizeof (MAP); For (INT I = 1; I <= N; I ++) {memset (VIS, 0, sizeof (VIS); If (BFS (I) A ++;} return a;} int main () {int I, J, K, cot1 = 0, ANS, a, B; while (~ Scanf ("% d", & N, & M, & K) {memset (PP, 0, sizeof (PP); for (I = 0; I <K; I ++) {scanf ("% d", & A, & B); PP [a] [B] = 1 ;} int COT = f (); ans = 0; for (I = 1; I <= N; I ++) {for (j = 1; j <= m; j ++) {If (PP [I] [J]) // determines whether it is important {PP [I] [J] = 0; If (f () <Cot) ans ++; PP [I] [J] = 1 ;}} printf ("board % d have % d important blanks for % d chessmen. \ n ", ++ cot1, ANS, Cot);} return 0 ;}