Small Change by MarkByers

#!ruby -pa
r={$F.map!{|x|x.to_i}.shift,[]}
$_='-
'
h={}
14.times{z={}
$F.each{|a|r.each{|k,v|h[k-=a]||=z[k]=[a]+v}}
r=r[0]?($_=r[0]*' '+$/;[]):z}

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

download

return top