var x,y,z,n,i:longint;
a,b,c:array[1..100]of longint;
f,p:array[0..20,0..20,0..20]of longint;
function wwj(a,b,c:longint):longint;
begin
if(a>=0)and(b>=0)and(c>=0)and(a<=20)and(b<=20)and(c<=20) then
if p[a,b,c]=1 then exit(f[a,b,c]);
if(a<=0)or(b<=0)or(c<=0) then wwj:=1
else
if(a>20)or(b>20)or(c>20) then wwj:=wwj(20,20,20)
else
if(a<b)and(b<c) then wwj:=wwj(a,b,c-1)+wwj(a,b-1,c-1)-wwj(a,b-1,c)
else
wwj:=wwj(a-1,b,c)+wwj(a-1,b-1,c)+wwj(a-1,b,c-1)-wwj(a-1,b-1,c-1);
if(a>=0)and(b>=0)and(c>=0)and(a<=20)and(b<=20)and(c<=20) then
begin
f[a,b,c]:=wwj;
p[a,b,c]:=1;
end;
end;
begin
while true do
begin
readln(x,y,z);
if(x=-1)and(y=-1)and(z=-1) then break;
inc(n);
a[n]:=x;
b[n]:=y;
c[n]:=z;
end;
for i:=1 to n do
writeln('w(',a[i],',',b[i],',',c[i],')=',wwj(a[i],b[i],c[i]));
end.
这个明明对的,而评判的时候一分也没有