Scanf.(Array.((scanf" %d %d %d"@@fun n m q->
	let a=make_matrix n n 0 in
	for _=1 to m do scanf" %d %d"@@fun l r->a.(l-1).(r-1)<-a.(l-1).(r-1)+1 done;
	for l=n-2 downto 0 do for r=0 to n-1 do
		a.(l).(r) <- a.(l).(r)+a.(l+1).(r) done;done;
	for r=0 to n-2 do for l=0 to n-1 do
			a.(l).(r+1) <- a.(l).(r+1)+a.(l).(r) done;done;
	for _=1 to q do
		scanf" %d %d"@@fun p q->Printf.printf"%d\n"a.(p-1).(q-1) done)))