| 记录编号 | 351262 | 评测结果 | AAAAAAAAAA | 
    
        | 题目名称 | 2549.删除他们! | 最终得分 | 100 | 
    
        | 用户昵称 |  Shirry | 是否通过 | 通过 | 
    
        | 代码语言 | C++ | 运行时间 | 0.042 s | 
    
        | 提交时间 | 2016-11-16 13:23:06 | 内存使用 | 0.32 MiB | 
    
    
    
    		显示代码纯文本
		
		#include<cstdio>
using namespace std;
int n,m,t,s,p,q;
char buf[1<<15],*fs,*ft;
inline char gc(){
	return fs==ft&&(ft=(fs=buf)+fread(buf,1,1<<15,stdin),fs==ft)?0:*fs++;
}
inline unsigned long long read(){
	unsigned long long x=0,ch=gc();
	bool rev=false;
	while(ch<'0'||ch>'9'){
		if(ch=='-')rev=true;
		ch=gc();
	}
	while(ch>='0'&&ch<='9'){
		x=(x<<1)+(x<<3)+ch-'0';
		ch=gc();
	}
	return rev?~x+1:x;
}
void del(){
	int x1,y1,x2,y2;
	x1=read();
	y1=read();
	x2=read();
	y2=read();
	int i,j;
	for(i=x1;i<=x2;i++){
		for(j=y1;j<=y2;j++){
			if(i<p-1){
				s--;
			}
			if(i==(p-1)){
				if(j<q){
					s--;
				}
			}
		}
	}
	p=s/m+1;
	q=(s+m)-(p*m);
}
int main(){
	freopen("deleteit.in","r",stdin);
	freopen("deleteit.out","w",stdout);
	n=read();
	m=read();
	t=read();
	s=n*m;
	p=n,q=m;
	int i;
	for(i=0;i<t;i++)del();
	printf("%d",s);
	return 0;
}