Description
This problem is a programming version of Problem 47 from projecteuler.net
The first two consecutive numbers to have two distinct prime factors are:
14=2×7
15=3×5
The first three consecutive numbers to have three distinct prime factors are:
2
644=2 ×7×23
645=3×5×43
646=2×17×19
Given N find all the K consecutive integers, where first integer is ≤N to have exactly K distinct prime factors. Print the first of these numbers in ascending order.
Input Format
Input contains two integers N and K.
Output Format
Print the answer corresponding to the test case. Print each integer in a new line.
Constraints
20≤N≤2×106
2≤K≤4
Sample Input#00
Sample Output#00
Sample Input#01
Sample Output




Reviews
There are no reviews yet.