2 shunfurh shunfurh 于 2017.01.15 21:27 提问

RSA Factorization

Description

The positive integer n is given. It is known that n = p * q, where p and q are primes, q <= p and |q - kp| <= 105 for some given positive integer k. You must find p and q.
Input

Each line contains integers n (1 < n < 10120) and k (0 < k < 108).
Output

For each pair of numbers n and k print in separate line the product p * q such that q <= p.
Sample Input

35 1
121 1
1000730021 9
Sample Output

5 * 7
11 * 11
10007 * 100003

1个回答

caozhy
caozhy   Ds   Rxr 2017.01.22 23:48
已采纳
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!