First iteration - correct algorithm, but too slow.

It runs in N^3, and as N=10^3, this won't work.
Minor optimization, still too slow

Previously, could do 4 test cases, now can do 5.
Still an O(N^3) algorithm, just slightly more optimized.
Final iteration: an N^2 log N algorithm

The key is, instead of looking at all triples, look at all pairs
to get the first throw. This will give us the upper and lower
bounds for the third value, so simply do binary search on the
(sorted) list for the upper/lower bounds, then take the diff.