#P1691D. Max GEQ Sum
Max GEQ Sum
No submission language available for this problem.
Description
You are given an array of integers. You are asked to find out if the inequality holds for all pairs of indices , where .
Each test contains multiple test cases. The first line contains the number of test cases (). Description of the test cases follows.
The first line of each test case contains a single integer () — the size of the array.
The next line of each test case contains integers ().
It is guaranteed that the sum of over all test cases does not exceed .
For each test case, on a new line output "YES" if the condition is satisfied for the given array, and "NO" otherwise. You can print each letter in any case (upper or lower).
Input
Each test contains multiple test cases. The first line contains the number of test cases (). Description of the test cases follows.
The first line of each test case contains a single integer () — the size of the array.
The next line of each test case contains integers ().
It is guaranteed that the sum of over all test cases does not exceed .
Output
For each test case, on a new line output "YES" if the condition is satisfied for the given array, and "NO" otherwise. You can print each letter in any case (upper or lower).
Samples
Note
In test cases and , the given condition is satisfied for all pairs.
In test case , the condition isn't satisfied for the pair as .