Guest User

Untitled

a guest
Jul 5th, 2019
3,457
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. n = int(input())
  2. a = list(map(int, input().split()))
  3. a.sort()
  4. if a[n-1]>=a[n-2] + a[n-3]:
  5. print("NO")
  6. else:
  7. print("YES")
  8. for i in range(n-1, -1, -2):
  9. print(a[i], end = " ")
  10. for i in range(n%2, n, 2):
  11. print(a[i], end = " ")
RAW Paste Data