# 傻逼的世界题目+题解

sbworld

var
c1,c2,c3,c4,c5,c6,c7,c8:array[1..105,1..105,1..105]of int64;
num,x1,y1,z1,x2,y2,z2,n,m,p:longint; v,s1,s2:int64;
function lowbit(x:longint):longint;
begin exit(x and(-x)); end;
var
i,j,k,tx,ty,tz:longint;
begin
tx:=x; ty:=y; tz:=z;
i:=x;
while i<=n do
begin
j:=y;
while j<=m do
begin
k:=z;
while k<=p do
begin
inc(c1[i,j,k],v);
inc(c2[i,j,k],v*tx);
inc(c3[i,j,k],v*ty);
inc(c4[i,j,k],v*tz);
inc(c5[i,j,k],v*ty*tz);
inc(c6[i,j,k],v*tx*tz);
inc(c7[i,j,k],v*tx*ty);
inc(c8[i,j,k],v*tx*ty*tz);
k:=k+lowbit(k);
end;
j:=j+lowbit(j);
end;
i:=i+lowbit(i);
end;
end;
function sum(x,y,z:longint):int64;
var
i,j,k,tx,ty,tz:longint;
begin
sum:=0;
tx:=x; ty:=y; tz:=z;
i:=x;
while i>0 do
begin
j:=y;
while j>0 do
begin
k:=z;
while k>0 do
begin
inc(sum,c1[i,j,k]*(tx+1)*(ty+1)*(tz+1));
dec(sum,c2[i,j,k]*(ty+1)*(tz+1));
dec(sum,c3[i,j,k]*(tx+1)*(tz+1));
dec(sum,c4[i,j,k]*(tx+1)*(ty+1));
inc(sum,c5[i,j,k]*(tx+1));
inc(sum,c6[i,j,k]*(ty+1));
inc(sum,c7[i,j,k]*(tz+1));
dec(sum,c8[i,j,k]);
k:=k-lowbit(k);
end;
j:=j-lowbit(j);
end;
i:=i-lowbit(i);
end;
end;
begin
fillchar(c1,sizeof(c1),0);
fillchar(c2,sizeof(c2),0);
fillchar(c3,sizeof(c3),0);
fillchar(c4,sizeof(c4),0);
fillchar(c5,sizeof(c5),0);
fillchar(c6,sizeof(c6),0);
fillchar(c7,sizeof(c7),0);
fillchar(c8,sizeof(c8),0);
while not eof do
begin
case num of
1:begin