This problem is a programming version of Problem 47 from projecteuler.net
The first two consecutive numbers to have two distinct prime factors are:
The first three consecutive numbers to have three distinct prime factors are:
Given find all the consecutive integers, where first integer is to have exactly distinct prime factors. Print the first of these numbers in ascending order.
Input Format
Input contains two integers and .
Output Format
Print the answer corresponding to the test case. Print each integer in a new line.
Constraints
Sample Input#00
20 2
Sample Output#00
14
20
Sample Input#01
644 3
Sample Output
644