Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- lst = [int(i) for i in input().split(" ")]
- lst.sort(reverse = True)
- c1 = c2 = 0
- for i in lst:
- if (c1 < c2):
- c1 += i
- else:
- c2 += i
- if (c1 <= c2*2 and c2 <= c1*2):
- print("YES")
- else:
- print("NO")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement