Description
This problem is a programming version of Problem 51 from projecteuler.net. We highly recommend to solve original first
By replacing the 1st digit of ∗3, it turns out that six of the nine possible values: 13, 23, 43, 53, 73, and 83, are all prime.
By replacing the 3rd and 4th digits of 56∗∗3 with the same digit, this 5−digit number is the first example having seven primes among the ten generated numbers, yielding the family: 56003, 56113, 56333, 56443, 56663, 56773, and 56993. Consequently 56003, being the first member of this family, is the smallest prime with this property.
Find the smallest N −digit prime which, by replacing K −digits of the number (not necessarily adjacent digits) with the same digit, is part of an L prime value family.
Note1: It is guaranteed that solution does exist.
Note2: Leading zeros should not be considered.
Input Format
Input contains three integers N, K and L.
Output Format
Print the first L numbers of the prime value family found in increasing order.
Constraints
2≤ N ≤7
1≤ K ≤ N
1≤ L ≤8
Sample Input#00
Sample Output#00
Sample Input#01
Sample Output#01




Reviews
There are no reviews yet.