Polyline#132

Polyline

1 segundo
64 megabytes
Media (≈1350)

In a rectangular coordinate system, a point M(x, y) is given. Connect point to the origin of the coordinates with a polyline in such a way that each successive segment is perpendicular to the next, and the length of each segment equals . Find the minimum possible length of such a polyline.

Entrada

The input consists of a single line containing two integers — the coordinates of the point M(x, y), where |x|, |y| < 100.

Salida

On the first line, output the number — the number of segments. Then output n + 1 pairs of integers — the coordinates of the successive vertices of the polyline starting from (0, 0).

Ejemplos

Ejemplo 1

Loading
Loading