loop {
    n, k = gets.split.map &:to_i
    break if n == 0
    a = (1..n).map { gets.to_i }
    max = sum = a[0..k-1].inject(:+)
    (1..n-k).map{|i|
        sum = sum - a[i-1] + a[i + k - 1]
        max = sum if sum > max
    }
    p max
}