Basically this problem asks you to implement a convex hull algorithm.
I implement Andrew’s Monotone Chain, a variant of Graham Scan, because it is not required to handle polar angle, which can be quite tricky. A reference solution is here.