RSA Factorization
The positive integer n is given. It is known that n = p * q, where p and q are primes, p<=q and |q-k*p|<10^5 for some given positive integer k. You must find p and q.
InputEach line contains integers n (1 < n < 10^120) and k (0 < k < 10^8).
OutputFor each pair of numbers n and k print in separate line the product p * q such that p<=q.
Input:
Output:
35 1
121 1
1000730021 9Output:
5 * 7
11 * 11
10007 * 100003Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.