All Tracks Data Structures Arrays 1-D Problem

Polygon Possibility
Tag(s):

Easy

Problem
Editorial
Analytics

You are given length of n sides, you need to answer whether it is possible to make n sided convex polygon with it.

Input : -

First line contains \(T\),no .of testcases.

For each test case , first line consist of single integer \(N\),second line consist of \(N\) \((l_1,l_2\dots l_n)\)spaced integers, size of each side.

Output : -

For each test case print "Yes" if it is possible to make polygon or else "No" if it is not possible.

\(1 \leq T \leq 10\)

\(1 \leq n \leq 10^5\)

\(1 \leq l_i \leq 10^4\)

SAMPLE INPUT
2
3
4 3 2 
4
1 2 1 4 
SAMPLE OUTPUT
Yes
No
Time Limit: 1.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: Bash, C, C++, C++14, Clojure, C#, D, Erlang, F#, Go, Groovy, Haskell, Java, Java 8, JavaScript(Rhino), JavaScript(Node.js), Julia, Kotlin, Lisp, Lisp (SBCL), Lua, Objective-C, OCaml, Octave, Pascal, Perl, PHP, Python, Python 3, R(RScript), Racket, Ruby, Rust, Scala, Swift, Swift-4.1, TypeScript, Visual Basic

CODE EDITOR

Initializing Code Editor...
Your Rating:

Contributor

Notifications
View All Notifications

?