#include #include using namespace std; int main(int argc, char* argv[]) { int X, Y, N; while (cin >> X >> Y >> N) { if (!X && !Y && !N) break; vector cols; vector rows; vector diag1; vector diag2; cols.resize(X, true); rows.resize(Y, true); diag1.resize(X+Y-1, true); diag2.resize(X+Y-1, true); int d2offset = Y-1; for (int i=0; i> x >> y; x--; y--; cols[x] = false; rows[y] = false; diag1[x+y] = false; diag2[x-y+d2offset] = false; } int places = 0; for (int y=0; y