Лимит времени 1000/1000/1000/1000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Problem description
Given two natural numbers. First of them A consists of exactly N ones, second B of exactly M ones. Find their greatest common divisor.
Input
There are two integers N and M on the first line (0 < N, M ≤ 2000).
Output
Write greatest common divisor of A = 11...1 (N times) and B = 11...1 (M times).
Example
Для отправки решений необходимо выполнить вход.
|