Result

AC

Duration

1244ms

Code [DL]

import std.stdio;
void main()
{int[30] a;
int i=0;
for(;readf(" %d",&a[i]);i++)if(i>2)a[i]-=a[i%3];
printf("%d\n",(a[3]*a[7]*a[11]+a[4]*a[8]*a[9]+a[5]*a[10]*a[6]-a[5]*a[7]*a[9]-a[8]*a[10]*a[3]-a[4]*a[11]*a[6])/6);
}

stdin

02 12 02
51 48 31
45 84 04
01 58 23

stdout

16075

stderr

strace