Result

AC

Duration

692ms

Code [DL]

q=require("fs").readFileSync(0).toString().split(/\s/).map(i=>parseInt(i))
let[,,,a,b,c,d,e,f,g,h,i]=q.map((e,i)=>e-q[i%3])
console.log((a*e*i+b*f*g+c*d*h-a*f*h-b*d*i-c*e*g)/6)

stdin

47 16 20
11 07 70
81 81 19
47 61 07

stdout

16887

stderr

strace