| RUCP x WiCS Mini-Contest |
|---|
| Finished |
Templates for this problem are available here.
Alice is standing at position $$$1$$$ of a straight road and wants to reach position $$$n$$$. Initially, she has $$$0$$$ stamina. On each day, she can do exactly one of the following:
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^4$$$). The description of the test cases follows.
The first line of each test case contains an integer $$$n$$$ ($$$2 \le n \le 2 \cdot 10^5$$$) — the number of positions on the road.
The second line of each test case contains $$$n$$$ integers $$$a_1, \ldots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the amount of stamina Alice gains by resting at position $$$i$$$.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$.
For each test case, output one integer — the minimum number of days Alice needs to reach position $$$n$$$.
341 1 1 141 2 3 453 1 3 1 3
656
In the first test case, Alice can rest at position $$$1$$$ for the first $$$3$$$ days and walk forward for the next $$$3$$$ days.
In the second test case, Alice can do the following:
| Name |
|---|


