Advertisement
Guest User

Untitled

a guest
Apr 29th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. Examples
  2. input
  3. 3
  4. 1 2 1
  5. output
  6. 1
  7. input
  8. 5
  9. 20 4 3 2 1
  10. output
  11. 11
  12. Note
  13. In the first example triangle with sides {1 + 1 = 2, 2, 1} can be formed from a set of lengths {1, 1, 1, 2}.
  14.  
  15. In the second example you can make a triangle with lengths {20, 11, 4 + 3 + 2 + 1 = 10}.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement