The Next Prime
Time limit1sMemory limit128 MB
For each of several integers n, print the smallest prime number greater than or equal to n.
- Level
Medium5 of 10
- Topics
- Number theory, Math
- Solved
- No attempts yet
Problem
Given an integer (), write a program that finds the smallest prime number that is greater than or equal to .
Input
The first line contains the number of test cases. Each test case consists of a single line containing one integer .
Output
For each test case, print the smallest prime that is greater than or equal to , one per line.