Polygonal chain - 2#150

Polygonal chain - 2

1 segundo
128 megabytes
Difícil (≈1650)
prb150

Find the number of different polygonal chains of minimal length that connect the origin to the point M(x, y), where each consecutive segment is perpendicular to the previous one and each segment has unit length.

Entrada

Two integers — the coordinates of point M(x, y), where -20 \le x, y \le 20.

Salida

Print the number of possible polygonal chains of minimal length.

Ejemplos

Ejemplo 1

Loading
Loading