Result

AC

Duration

448ms

Code [DL]

a={}for k=1,4 do for s in string.gmatch(io.read(),"%w+")do a[#a+1]=s end end
for z=1,9 do a[z]=a[z]-a[10+~-z%3]end
s=0
for z=1,3 do q=-~z%3;s=s+a[z]*(a[7+z%3]*a[4+q]-a[4+z%3]*a[7+q])end
print(math.floor(s/6))

stdin

05 64 31
72 71 37
46 68 58
20 36 70

stdout

7583

stderr

strace