Result

AC

Duration

669ms

Code [DL]

JS{{{var p,q,s=0,z=9,a=(require('fs').readFileSync(0)+"").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

80 54 18
14 71 70
08 72 99
22 99 10

stdout

7704

stderr

strace