Subarray with least average
Submissions: 5189   Accuracy:

25.1%

  Difficulty: Easy   Marks: 2

Find the subarray with least average of size K. Given an array arr[] of size n and integer k such that k <= n.

Input:
The first line contains an integer 'T' denoting the total number of test cases. In each test cases, the first line contains an integer 'N' and 'K' denoting the size of array. The second line contains N space-separated integers A1, A2, ..., AN denoting the elements of the array.


Output:
The first and last index of the subarray. (Index begins from 1).

Note: You may assume that there will only be one unique solution.


Constraints:
1<=T<=30
1<=N<=1000
1<=K<=N
1<=A[i]<=103

Example:
Input:
1
3 1
30 20 10 

Output:
3 3

** For More Input/Output Examples Use 'Expected Output' option **

Author: abhiraj26


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.