Result

AC

Duration

5983ms

Code [DL]

import java.util.*
fun main(a:Array<String>){var x=0
val X=IntArray(12)
val s=Scanner(System.`in`)
repeat(12){i->X[i]=s.nextInt()-X[i%3]
x+=i/9*X[i]*(X[(i+1)%3+3]*X[(i+2)%3+6]-X[(i+1)%3+6]*X[(i+2)%3+3])}
print(x/6)}

stdin

43 84 36
97 18 56
41 01 07
97 06 12

stdout

30784

stderr

strace