Shivigawdz

All submissions for this problem are available.
Shivigawdz judges the "efficiency" of his Death Note as the average number of people he can kill per page. His shinigami, Siddhant, had already written a number of names. However, Siddhant was every uneven in how he used the Death Note. Shivigawdz wants to use some of the N pages of the death note on the first day such that he has maximum efficiency. Given the number of people he can kill using each page, help him select a continuous set of atleast $A$ and atmost $B$ pages which help him get the maximum efficiency. In formal language, given an array of length $N$, find the maximum average of the numbers of any contiguous subarray of length between $A$ and $B$, inclusive. ###Input: The first line of the input contains $T$, the number of testcases. The first line of the each test case contains 3 integers, $N$, $B$ and $A$ ($A \leq B$). The next line contains $N$ numbers, the number of names that can be written in the $i$th page of the Death Note, for all $1 \leq i \leq N$. ###Output: Output 1 number, the maximum efficiency Shivigawdz can attain. NOTE: You must output the answer correct upto atleast 6 decimal places ###Constraints  $1 \leq N \leq 1000$  $1 \leq T \leq 5$  All numbers in the array are between $0$ and $10^{10}$ (inclusive) ###Subtasks  100 points : $1 \leq N \leq 1000$ ###Sample Input: 1 5 3 2 1 2 3 4 5 ###Sample Output: 4.5000000 ###EXPLANATION: He can use pages 4 and 5 for an average of (4+5)/2=4.5Author:  kjain1810 
Editorial  https://discuss.codechef.com/problems/SHIVIGOD 
Tags  akashbhalotia, cakewalk, ico, icop1904, kjain1810, prefixsums, slidingwindow 
Date Added:  10012019 
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, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, COB, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions