A no is said to be k-Almost Prime Number if it has exactly k prime factors (not necessary distinct). Your task is to complete the function printKAlmostPrimes which takes two argument k and N and prints the first N numbers that are k prime.
The first line of input is the no of test cases . Then T test cases follow . Each test case contains two integers k and N .
For each test case output will be N space separated first N numbers that are k prime numbers.
Example(To be used only for expected output):
4 6 9 10 14
In above test case
4 has two prime factors, 2 x 2
6 has two prime factors, 2 x 3
Similarly, 9(3 x 3), 10(2 x 5) and 14(2 x 7)
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.