Result

AC

Duration

522ms

Code [DL]

X={}
for i=-3,8 do
X[i]=io.read("*n")-(X[i%3-3]or 0)
p=-~i%3
q=~-i%3
x=i>5 and x+X[i]*(X[p]*X[q+3]-X[q]*X[p+3])or 0
end
print(x//6)

stdin

67 90 35
22 59 02
66 07 58
52 95 44

stdout

15076

stderr

strace