Company: Flipkart
Difficulty: medium
Primal Compass You are exploring the *Primal Compass*, an ancient device that reveals Dreamworlds by pointing to a sequence of prime numbers. Every prime the compass points to has a digit sum equal to a given integer `N`. The compass only ever reaches primes **below 100000**. Among those primes, taken in increasing order, report the first `K` whose decimal digits add up to `N`. Input Format The first line contains a single integer `N`, the required digit sum. The second line contains a single integer `K`, the number of prime numbers to be generated. Output Format Print the first `K` prime numbers below `100000` whose digit sums equal `N`, in increasing order, separated by single spaces, on one line. If there are fewer than `K` such primes below `100000`, print all of the primes found. If no such prime numbers are found, print `-1`. Constraints `1 <= N <= 45` `1 <= K <= 10000` Only primes strictly below `100000` are ever considered. All printed values fit in a 32-bit signed