Description
This problem is a programming version of Problem 52 from projecteuler.net
It can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order.
Given N, find all the positive integers, x ≤ N, such that x,2x,⋯Kx contain the same digits.
Input Format
Input contains two integers N and K
Output Format
Print all the K multiple corresponding to the test case. If there are more than 1 x print each of them in a new line.
Note1: It is guaranteed a solution exists.
Note2: You should not consider solution with leading 0’s.
Constraints
125875 ≤ N ≤ 2000000
2 ≤ K ≤ 6
Sample Input
Sample Output




Reviews
There are no reviews yet.