Key
Time limit1sMemory limit128 MB
Find every odd K in [A, B] such that (K-1)! is not a multiple of K^2, where B - A is at most 100 but B can be 10^18.
- Level
Medium7 of 10
- Topics
- Number theory, Math, Probability, Brute force
- Solved
- No attempts yet
Problem
While cracking the passwords of several data encryption systems, a novice hacker discovered the rule by which encryption keys are formed. An encryption key is an odd integer that satisfies both of the following conditions:
- does not divide ; that is, is not a multiple of .
Here .
Find all possible encryption keys within the range .
Input
Two integers and are given on a single line, separated by a space. (, )
Output
Print all encryption keys in the range on a single line, in ascending order, separated by single spaces. It is guaranteed that at least one key exists in the range.