Result

AC

Duration

701ms

Code [DL]

c>1-:fia*iv
v^?:p@~i+ <
>3>1-::3+:fg@@fg-$fp::6+:fg@v
v8^?:pf$-gf@@gf:+9::pf$-gf@ <
>fgafg*7fgbfg*-3fg*6fgbfg*8fg9fg*-4fg*7fg9fg*6fgafg*-5fg*++6,n;

stdin

58 22 72
22 36 78
08 49 05
02 32 05

stdout

8784

stderr

strace