Convex hull#4774

Convex hull

1 second
122.174 megabytes
Very easy

Given points on a plane, your task is to construct their convex hull. It is guaranteed that the convex hull is not degenerate.

Input

The first line contains the integer (3 \leq n \leq 10^5), representing the number of points. Each of the following lines contains two integers x_i and y_i (-10^9 \leq x_i, y_i \leq 10^9), which are the coordinates of the points.

Please note: The points are arbitrary and may include duplicates. Additionally, a large number of points may lie on the same line.

Output

On the first line, output the number of vertices of the convex hull. The subsequent lines should list the coordinates of the vertices in the order they are traversed. Ensure that no three consecutive points are collinear.

Examples

Example 1

Loading
Loading