RSA Mistake
InterviewTime limit1sMemory limit1024 MB
Given A and B, output full credit if they are distinct primes, partial credit if A*B has no square factor k^2 with k at least 2, otherwise no credit.
- Level
Medium5 of 10
- Topics
- Math, Number theory
- Solved
- No attempts yet
Problem
An RSA number is a positive integer that is the product of two distinct primes. For example, and are RSA numbers, whereas , , and are not.
You are teaching a course that covers RSA cryptography. For one assignment, you asked students to generate RSA numbers. They were to submit two positive integers and . Ideally, these would be distinct prime numbers. Some students submitted incorrect solutions. If they were not distinct primes, partial credit is earned if is not an integer multiple of for any integer . If there is an integer such that divides , the student receives no credit.
Note: In the sixth sample case, the number is divisible by . In the seventh sample case, the number is divisible by .
Input
The input consists of a single line containing two integers () and (), which are the two submitted numbers.
Output
Display whether the student should receive full credit, partial credit, or no credit for the submitted numbers.