Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register
Language:
RSA Factorization
Time Limit: 1000MSMemory Limit: 65536K
Total Submissions: 669Accepted: 176

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

Source

[Submit]   [Go Back]   [Status]   [Discuss]

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator