Small Change by 51b

import std.stdio;void main(){int[99]a;for(int i,x,y;~scanf("%d%c",&a[i++],&y);)if(y<11){int[]c=[0];int[9999]d;try{for(;*c-*a;c=c[1..$])for(y=i;--y;)*c<*a&!d[x=*c+a[y]]&&(c~=x,d[x]=~*c);for(;x;*a=x)x=~d[*a],write(*a-x,x?" ":\n);}catch{puts="-";}i=0;}}

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

download

return to the top page