#include char cb[20001][20001]; int main() { int N = 0; int cb_X = 0; int cb_Y = 0; while(scanf("%d %d %d", &cb_X, &cb_Y, &N)){ int count = 0; for(int i=0; i= (vetsi - 1)){ printf("0\n"); }else{ for(int i = 0; i < N; i++){ int q_x = 0; int q_y = 0; scanf("%d %d", &q_x, &q_y); q_x = q_x-1; q_y = q_y-1; for(int x = 0; x < cb_X; x++){ //prochazeni x osou if(cb[q_y][x] != 'x') { cb[q_y][x] = 'x'; count++; } } for(int y = 0; y < cb_Y; y++){ //prochazeni y osou if(cb[y][q_x] != 'x') { cb[y][q_x] = 'x'; count++; } } if(q_y=0, pomX2<=cb_X; y--) { if(cb[y][pomX2] != 'x') { cb[y][pomX2] = 'x'; count++; } pomX2++; } int pomY2 = q_y; for(int x=q_x; x>=0, pomY2<=cb_Y; x--) { if(cb[pomY2][x] != 'x') { cb[pomY2][x] = 'x'; count++; } pomY2++; } } } int celek = cb_X*cb_Y - count; printf("%d\n",celek); } return 0; }