read N K
if [ $N -gt 100 ]; then
    tr ' ' '\n'|awk '{a[NR]=0;for(p in a)if('$N'-NR+p>100)print (a[p]+=$0)}'
else
    tr ' ' '\n'|awk '{a[NR]=0;for(p in a)print (a[p]+=$0)}'
fi|sort -nr|awk '{a[NR]=$0}END{'"$(yes 'for(p=q+1;p<=NR;p++)'|head -$K|awk '{gsub("p","i" NR);gsub("q","i" NR-1);print}')"'{n=and('"$(yes 'a[p]'|head -$K|awk '{gsub("p","i" NR);print}'|tr '\n' ,|sed 's/,$//')"');if(m<n)m=n};print m}'|sort -nr|head -1
