RSA Factorization
Time limit1sMemory limit128 MB
Given a huge n up to 10^120 and k, find primes p ≤ q with n = p*q and |q - kp| bounded by 10^5, requiring advanced factorization insight.
- Level
Hard9 of 10
- Topics
- Number theory, Math, Binary search
- Solved
- No attempts yet
Problem
Given positive integers and , write a program that finds prime numbers and such that , , and .
Input
The first line contains and (, ).
Output
On the first line, print the prime numbers and that satisfy the conditions, in the form p * q.