In the last round before overtime, the score is 11:12. Chmyaks and the one who will do everything for skins, aka Lucy, need to clutch vs . However, instead of that, Lucy decided to ask Chmyaks riddles. Chmyaks doesn't have time to solve them (he needs to rush the Palace with the AWP), so he's asking you to solve the riddles for him, so Lucy can also go to land shots with the Deagle. Here's one of the riddles.
Given an array of length and a number , for each index (1 \le i \le n) you need to find a subarray that includes the element at index and has the maximum possible sum that does not exceed and either output the sum of it or say that it is impossible.
More formally, for each (1 \le i \le n) we need to find such (l \le i \le r) that \sum_{j=l}^{r} a_j \le s and \sum_{j=l}^{r} a_j is the biggest possible and output \sum_{j=l}^{r} a_j.
Each test contains multiple test cases. The first line contains the number of test cases (1 \le t \le 4 \cdot 10^5). The description of the test cases follows.
The first line of each test case contains two integers (1 \leq n \leq 10^6) and (-10^9 \leq s \leq 10^9).
The second line contains integers a_i (-10^9 \leq a_i \leq 10^9) representing the elements of the array.
It is guaranteed that the sum of over all test cases does not exceed 10^6.
For each test case, for each (1 \le i \le n), output either an integer — the answer for this , or if it is impossible.
Example 1
Here, is the sum of in all test cases.
( points): N \le 500;
( points): N \le 1000;
( points): a_i \ge 0;
( points): s > 0;
( points): N \le 5 \cdot 10^4;
( points): N \le 10^5;
( points): N \le 6 \cdot 10^5;
( points): no additional constraints