Result [link]

AC

Code [DL]

)vg:48nS;a
M?(""*:?)0
_:?)@@2nM_
?)nAdu@@10
_NmO?)10nD
nF;aM?(#[w
RaC*;31bR#
:tSsP;aEvn

stdin

0011000000011110100010010000010111001110110010001110111010101111011101100111000011001110011011111101

stdout

0238275125077684759816028612349

stderr

strace