Result

AC

Duration

679ms

Code [DL]

JS{{{var p,q,s=0,z=9,a=require('fs').readFileSync('/dev/stdin','utf8').split(/\s/)
for(;z--;s-=z<3&&a[z]*(a[p=3+-~z%3]*a[q=6+(z+2)%3]-a[q-3]*a[p+3]))a[z]-=a[9+z%3]
console.log(s/6)}}}

stdin

39 08 30
04 08 78
20 67 64
11 55 16

stdout

20212

stderr

strace