Time limit
1s
Memory limit
128 MB
A sequence of daily temperatures is given. For a fixed number K, find the largest possible sum of temperatures over any K consecutive days.
Write a program that computes this maximum K-day sum.
The first line contains two integers N and K separated by a space.
The second line contains N integers separated by spaces. Each integer is a daily temperature, and every temperature is between -100 and 100 inclusive.
Print the maximum sum among all consecutive K-day temperature sums.