RSA Factorization
Very easy
Execution time limit is 2 seconds
Runtime memory usage limit is 64 megabytes
The positive integer n is given. It is known that n = p * q, where p and q are primes, p <= q and |q-kp|<=10^5 for some given positive integer k. You must find p and q.
Input
Each line contains integers n (1 < n < 10^120) and k (0 < k < 10^8).
Output
For each pair of numbers n and k print in separate line the product p * q such that p <= q .
Examples
Input #1
Answer #1
Submissions 200
Acceptance rate 40%