Codeforces Round 703 (Div. 2)
A
Shifting Stacks
Codeforces
900
原题
←B →
翻译中…

You have $n$ stacks of blocks. The $i$-th stack contains $h_i$ blocks and it's height is the number of blocks in it. In one move you can take a block from the $i$-th stack (if there is at least one block) and put it to the $i + 1$-th stack. Can you make the sequence of heights strictly increasing?

翻译中…

Note that the number of stacks always remains $n$: stacks don't disappear when they have $0$ blocks.

翻译中…

Input

翻译中…

First line contains a single integer $t$ $(1 \leq t \leq 10^4)$ — the number of test cases.

翻译中…

The first line of each test case contains a single integer $n$ $(1 \leq n \leq 100)$. The second line of each test case contains $n$ integers $h_i$ $(0 \leq h_i \leq 10^9)$ — starting heights of the stacks.

翻译中…

It's guaranteed that the sum of all $n$ does not exceed $10^4$.

翻译中…

Output

翻译中…

For each test case output YES if you can make the sequence of heights strictly increasing and NO otherwise.

翻译中…

You may print each letter in any case (for example, YES, Yes, yes, yEs will all be recognized as positive answer).

翻译中…

Note

翻译中…

In the first test case there is no need to make any moves, the sequence of heights is already increasing.

翻译中…

In the second test case we need to move one block from the first stack to the second. Then the heights become $0$ $1$.

翻译中…

In the third test case we could move one block from the first stack to the second and then from the second to the third, which would make the heights $3$ $4$ $5$.

翻译中…

In the fourth test case we can't make a move, but the sequence is not increasing, so the answer is NO.

翻译中…

In the fifth test case we can only make one move (from the second to the third stack), which would make the heights $0$ $0$ $1$. Both $0$ $1$ $0$ and $0$ $0$ $1$ are not increasing sequences, so the answer is NO.

翻译中…

样例

Input #1
6
2
1 2
2
1 0
3
4 4 4
2
0 0
3
0 1 0
4
1000000000 1000000000 1000000000 1000000000
Output #1
YES
YES
YES
NO
NO
YES
InputCopy OutputCopy
题目信息
题号
1486A
时间限制
1 s
内存限制
256 MB
标签
贪心
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。