Ruman and Pull Requests

All submissions for this problem are available.
Ruman loves creating software. He has recently created a new [open source](https://en.wikipedia.org/wiki/Opensource_software) project which is gaining popularity exponentially. Many skilled developers all across the globe want to contribute to his project. [Pull resuests](https://help.github.com/en/github/collaboratingwithissuesandpullreq...) are just flowing in every day. There are a lot of options for Ruman, but he doesn't have time to address each one of them. His project has received pull requests in the past $N$ days consecutively, and the sequence $A_{1}, \dots, A_{N}$ describes the number of requests received each day. Now, he wants to check as many requests as possible but not exceeding $K$, because there's a limit to everything. And, he wants to pick requests only from a contiguous subsequence of days. If there are multiple such contiguous subsequences for which the pull requests are maximum possible (not exceeding $K$), then he'll prefer the range of days which starts the earliest. ### Input:  The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.  The first line of each test case contains two space separated integers $N$ and $K$.  The second line contains $N$ space separated integers $A_{1}, A_{2}, \dots, A_{N}$. ### Output: For each test case print a single line containing three space separated integers $L$, $R$ and $\sum\limits_{i = L}^{R}{A_{i}}$. If it is not possible to find such a contiguous segment, print $1$ in a single line. ### Constraints:  $1 \leq N \leq 10^{5}$  $1 \leq A_{i} \leq 10^{9}$, for each valid $i$  $1 \leq K \leq 10^{14}$  Sum of $N$ over all test cases doesn't exceed $10^{6}$ ### Subtasks:  **10 points:** $1 \leq N \leq 100$ $1 \leq K \leq 10^{11}$ Sum of $N$ over all test cases doesn't exceed $100$  **30 points:** $1 \leq N \leq 10^{3}$ $1 \leq K \leq 10^{12}$ Sum of $N$ over all test cases doesn't exceed $10^{3}$  **60 points:** original constraints ### Sample Input: 3 3 2 1 1 1 3 12 1 7 2 3 5 6 6 6 ### Sample Output: 1 2 2 1 3 10 1Author:  ankushkhanna 
Editorial  https://discuss.codechef.com/problems/DWW19D 
Tags  ankushkhanna, ankushkhanna, binarysearch, dwwu2019, easy, prefixsum, slidingwindow, twopointers 
Date Added:  29122019 
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 
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. 