Distribute by I., S.

m@main=readLn>>=print.foldl f([],[])>>m
f(l,r)y|sum l>sum r=(l,r++[y])|0<1=(l++[y],r)

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page