Result

AC

Duration

1526ms

Code [DL]

import std.stdio;void main(){int p,q,x,i;for(int[12]X;readf("%d ",p);)x+=i/9*(X[i]=p-X[i%3])*(X[p=++i%3+3]*X[q=-~i%3+6]-X[p+3]*X[q-3]);write(x/6);}

stdin

54 72 78
02 48 34
71 61 26
01 08 40

stdout

23866

stderr

strace