The Great Run

All submissions for this problem are available.
Vishal loves running. He often visits his favourite Nehru Park and runs for very long distances. On one such visit he found that the number of girls in the park was unusually high. Now he wants to use this as an opportunity to impress a large number of girls with his awesome speed. The track on which he runs is an $\text{N}$ kilometres long straight path. There are $\mathbf{a_i}$ girls standing within the $\text{ith}$ kilometre of this path. A girl will be impressed only if Vishal is running at his maximum speed when he passes by her. But he can run at his best speed only for a single continuous stretch of $\text{K}$ kilometres. Now Vishal wants to know what is the maximum number of girls that he can impress. ###Input First line of the input contains the number of testcases $\text{T}$. For each test case, First line contains two spaceseparated integers $\text{N}$ and $\text{K}$, the length of the track and the maximum distance he can run at his best speed. Second line contains N spaceseparated integers, the number of girls within each kilometre of the track. ###Output For each test case print one line containing an integer, denoting the maximum number of girls Vishal can impress. ###Constraints $1 \leq \text{T} \leq 10$ $1 \leq \text{K} \leq \text{N} \leq 100$ $1 \leq \mathbf{a_i} \leq 100$ ###Sample Input 1 7 2 2 4 8 1 2 1 8 ###Sample Output 12 ###Explanation He can impress 4+8=12 girls if he runs at his best speed between the 2nd and the 3rd kilometre, inclusive.Author:  meetsid20 
Tags  meetsid20 
Date Added:  8082018 
Time Limit:  0.5 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, COB, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 