Result

AC

Duration

1923ms

Code [DL]

a=`dd`.split.map &.to_i;p (0..8).map{|z|z/6*(a[z]-=a[9+z%3])*(a[s=3+-~z%3]*a[t= ~-z%3]-a[t+3]*a[s-3])}.sum/6

stdin

54 01 79
43 25 76
97 19 54
41 52 40

stdout

5744

stderr

0+1 records in
0+1 records out
36 bytes copied, 5.1581e-05 s, 698 kB/s

strace