Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Examples
- input
- 3
- 1 2 1
- output
- 1
- input
- 5
- 20 4 3 2 1
- output
- 11
- Note
- In the first example triangle with sides {1 + 1 = 2, 2, 1} can be formed from a set of lengths {1, 1, 1, 2}.
- 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