Monotone Chain algorithm