Олимпиадный тренинг

Задача 21838. numbers


Задача

Темы:

Arthur has two natural numbers — x and y (x < y). Help him find a natural number z such that:

  • z > x;
  • z > y;
  • z is not divisible by x;
  • z is not divisible by y;
  • z is divisible by y - x;
  • z minimal.

Input data format

The first line contains numbers x and y (xy ≤ 10< sup>6)

Output Format

Print the number z or '0' if it doesn't exist.

Input:
1 2

Output:
0