x:array[-2..7,-2..11]of boolean;
a,b,c,d,n,m,t,y,u,g:int64;
Procedure sxt(u:int64);
begin
if (u=1) and (x[t+1,y]) then t:=t+1 ;
if (u=2) and (x[t-1,y]) then t:=t-1 ;
if (u=3) and (x[t,y+1]) then y:=y+1 ;
if (t=c) and (y=d) then
inc(g);
end;
begin
read(a,b,c,d);
for i:=-2 to 7 do
for j:=-2 to 11 do
x[i,j]:=true;
g:=0;i:=0;j:=0;
for i:=1 to 8 do
x[0,i]:=false;
for i:=1 to 4 do
x[i,0]:=false;
for i:=1 to 8 do
x[5,i]:=false;
for i:=1 to 4 do
x[i,9]:=false;
x[c+1,d+2]:=false;x[c+1,d-2]:=false;
x[c+2,d+1]:=false;x[c+2,d-1]:=false;
x[c-1,d+2]:=false;x[c-1,d-2]:=false;
x[c-2,d+1]:=false;x[c-2,d-1]:=false;
for h1:=1 to 3 do
begin
t:=1;y:=1;
sxt(h1);
for h2:=1 to 3 do
begin
sxt(h2);
for h3:=1 to 3 do
begin
sxt(h3);
for h4:=1 to 3 do
begin
sxt(h4);
for h5:=1 to 3 do
begin
sxt(h5);
for h6:=1 to 3 do
begin
sxt(h6);
for h7:=1 to 3 do
begin
sxt(h7);
for h8:=1 to 3 do
begin
sxt(h8);
for h9:=1 to 3 do
begin
sxt(h9);
for h10:=1 to 3 do
begin
sxt(h10);
for h11:=1 to 3 do
begin
sxt(h11);
for h12:=1 to 3 do
begin
sxt(h12);
for h13:=1 to 3 do
begin
sxt(h13);
for h14:=1 to 3 do
sxt(h14);
end;
end;
end;
end;
end;
end;
end;
end;
end;
end;
end;
end;
end;
writeln(g);
End.
暴力枚举。。。<^_^>