Result

AC

Duration

481ms

Code [DL]

@z=glob`dd`;$A+=int($_/6)*(@z[$_][email protected][$_+3])*(@z[++$_%3+3]*@z[$t=($_%3+1)%3][email protected][$_%3]*@z[$t+3])for(0..8);print$A/6

stdin

09 74 65
81 61 90
97 52 09
13 96 01

stdout

28396

stderr

0+1 records in
0+1 records out