Small Change by murky-satyr

for(;a=readline(b={}).split(/\D/),$=+a[0];print(b[$]||'-'))for(q=[i=0];t=q[i++],t>=0;)for(j=t<$;c=+a[++j];b[u=c+t]?1:b[u]=q.push(u)&&_?_+' '+c:c)_=b[t]

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

download

return to the top page