var
f:array[0..100,0..100]of boolean;
ans:array[0..100,0..100]of int64;
i,j,a,b,n,k,x,y:longint;
begin
while not eof do begin
readln(n);
if n=0 then break;
readln;
for k:=1 to n do begin
fillchar(f,sizeof(f),true);
fillchar(ans,sizeof(ans),0);
readln(a,b);
if((a=0)or(b=0)) then break;
for i:=0 to a do f[i,0]:=false;
for i:=0 to b do f[0,i]:=false;
ans[1,1]:=1;
for i:=1 to a do begin
read(x);
while not eoln do begin
read(y);
f[x,y]:=false;
end;
end;
for i:=1 to a do
for j:=1 to b do begin
if((i=1)and(j=1)) then continue;
if f[i,j]=true then ans[i,j]:=ans[i-1,j]+ans[i,j-1];
end;
writeln(ans[a,b]);
if k<>n then writeln;
end;
end;
end.
为什么会OLE??