- Problem Statement.
- A
**main()**with the examples compiled in. - A skeleton that compiles with
**main.cpp**. -
**Problem Given in Topcoder**: August, 2016 -
**Competitors who opened the problem**: 351 -
**Competitors who submitted a solution**: 329 -
**Number of correct solutions**: 301 -
**Accuracy (percentage correct vs those who opened)**: 85.8% -
**Average Correct Time**: 12 minutes, 5 seconds.

If the sum of the two shorter sides is greater than the longest side, then you don't need to do any shortening.

So, the challenge here is to identify the sides as "two shortest" and "longest."
The answer to doing this quickly and reliably is to use *sorting*. What
I did was put all three sides into a vector, and then use the **sort()** method
from **algorithms** to sort it. Now, it's easy to identify the two shorter
sides, and the longest one. This works even when the length of the sides are not
unique (as in example 1).

You can use a **multiset** or **multimap** to do the sorting, too, although I
think that the vector is easier. What you don't want to do is put in a bunch of **if**
statements to try to identify the longest side and shortest sides. That is a bug-prone
exercise.