The factorial of a number , denoted as , is equal to the product of all natural numbers up to and including . For example,
Given two numbers and , what is the smallest value of such that has at least factors of (that is, divides evenly into )?
The standard input will contain 10 datasets. Each dataset contains two integers , .
For the first 4 cases, is prime and .
For the first 7 cases, .
For each dataset, output the minimum value of such that has at least factors of .
Sample Input (Five Datasets Shown)
2 2 2 3 3 1 4 2 10 10
4 4 3 6 45