| 2 | using namespace std; |
| 3 | |
| 4 | int main() { |
| 5 | // your code goes here |
| 6 | |
| 7 | int t; |
| 8 | cin>>t; |
| 9 | |
| 10 | while(t--) |
| 11 | { |
| 12 | int n,sum=0; |
| 13 | cin>>n; |
| 14 | int arr[n+2]; |
| 15 | //i have taken an array with increased size because sometimes tight arrays throws bound error |
| 16 | //and in this case it was |
| 17 | |
| 18 | for(int i=0;i<n;i++){ |
| 19 | cin>> arr[i]; |
| 20 | sum=sum+arr[i]; |
| 21 | } |
| 22 | //then i stored the sum of array elements in a variable sum |
| 23 | //if it was greater or equal to zero the output says YES |
| 24 | if(sum>=0){ |
| 25 | cout<<"YES"<<endl; |
| 26 | } |
| 27 | //else no |
| 28 | |
| 29 | else{ |
| 30 | cout<<"NO"<<endl; |
| 31 | } |
| 32 | |
| 33 | |
| 34 | } |
| 35 | return 0; |
| 36 | } |
nothing calls this directly
no outgoing calls
no test coverage detected