2752. RSA Factorization

单点时限: 5.0 sec

内存限制: 256 MB

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

输入格式

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

输出格式

For each pair of numbers n and k print in separate line the product p * q such that

p<=q .

样例

Input
35 1
121 1
1000730021 9
Output
5 * 7
11 * 11
10007 * 100003

4 人解决,5 人已尝试。

27 份提交通过,共有 88 份提交。

7.5 EMB 奖励。

创建: 14 年,5 月前.

修改: 6 年,8 月前.

最后提交: 13 年,8 月前.

来源: Southeastern European Regional Programming Contest 2009

题目标签