UVa 218 - Moth Eradication

Summary
This is just a straightforward planar Convex Hull problem. An $$O(nlogn)$$ solution will definitely pass.

Explanation
We are given n points in the plane, and must find the smallest perimeter polygon containing all of the given points. It's not hard to see that the Convex Hull is what is needs to be computed.

Gotcha's

 * Before careful that your code handles co-linear points on the hull.

Input
Input here

Output
Output here