sunjunhan 2015-08-21 05:14:05
点我顶贴
收藏
删除
var a,f:array [-1..22,-1..22] of int64;
n,m,i,j,x,y:longint;
BEGIN
readln(n,m,x,y);
f[x,y]:=-1;
f[x-2,y-1]:=-1;
f[x-2,y+1]:=-1;
f[x+2,y-1]:=-1;
f[x+2,y+1]:=-1;
f[x-1,y-2]:=-1;
f[x-1,y+2]:=-1;
f[x+1,y-2]:=-1;
f[x+1,y+2]:=-1;
f[0,0]:=1;
for j:=0 to m do
for i:=0 to n do
if f[i,j]<>-1 then
begin
if f[i,j-1]<>-1 then f[i,j]:=f[i,j]+f[i,j-1];
if f[i-1,j]<>-1 then f[i,j]:=f[i,j]+f[i-1,j];
end;
writeln(f[n,m]);
END.