read b read n read -dx s for c in $s { a[b+=c,c]+=\ $c } a=(${a[@]}) v=a[n/2] for c in $s {((c-=v