Ketekon and Chips
All submissions for this problem are available.###Problem Statement: There are $N$ chips packets numbered (1,2..N) containing $A[i]$ chips in it. Ketekon (King of Keteki Country), loves to eat a lot of chips,but the king can take only $k$ consecutive chips packets ,beacuse $K$eteki Country follows the $K$-Rule. Find the maximum number of chips which the king can have. ###Input: The first line of the input contains 2 space-separated integers $N$ and $K$. The second line contains $N$ space separated integers denoting the number of chips in packet $A[i]$. ###Output: Output the maximum number of chips, the King can have. ###Constraints: $1 \leq N,K \leq 10^5$ $1 \leq K \leq N$ $1 \leq A[i] \leq 10^9$ ###Sample Input: 5 2 5 1 4 3 2 ###Sample Output: 7 ###Explanation: King can have chips from Packets 3,4 which are continuous and has the maximum total number of chips.
|Tags||gabilash, keteki, kpm22019|
|Time Limit:||1 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, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions