#encoding:utf-8 No.0516 2014.11.16
while true
  n,k = gets.chomp.split.map{|item| item.to_i}
  if n == 0 && k == 0
    break
  end
  num = Array.new(n)
  n.times do |i|
    num[i] = gets.chomp.to_i
  end

  idx = 0
  while num[idx,k].length == k
    sum = 0
    num[idx,k].each do |item|
      sum += item
    end

    case idx
    when 0
      max = sum
    else
      if sum > max
        max = sum
      end
    end
    idx += 1
  end

  puts max
end