Rectangle Covered with Squares#5155

Rectangle Covered with Squares

1 second
64 megabytes
Easy

Given a rectangle with integer sides and , find the largest possible side length of identical squares such that the rectangle can be completely covered by these squares, with none of the squares extending beyond the boundaries of the rectangle.

\InputFileTwo natural numbers and (0 < a,\ b < 2\ 000\ 000\ 000).

\OutputFileOutput a single integer—the side length of the square.

Examples

Example 1

Loading
Loading