Read two positive natural numbers n and L with L <= n, then n integers forming a sequence v[1], v[2], ..., v[n]. Find the contiguous subarray of exactly L elements whose sum is greatest.
Because dividing by L preserves order, a window of length L with the greatest sum also has the greatest average, so the problem is equivalent to finding the fixed-length window of maximum average.
Print the position of the first element of that window (numbered from 1) and the value of the sum. If there are several windows of length L with the same maximum sum, choose the first.