[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
f[]=[] f(x:s)=[[x]]++map(x:)(f s) g[]=[] g(x:s)=f(x:s)++g s h[a]=a h(a:b)|sum a>sum(b!!0)=h(a:tail b)|1>0=h b i s=filter((< l s).l)$g$map read$s++init s l=length m@main=getLine>>=putStrLn.unwords.map show.h.i.words>>m