问题3794--Next Prime

3794: Next Prime

[命题人 : ]
时间限制 : 3.000 sec  内存限制 : 64 MB

题目描述

Given an integer n, with 0 <= n <= 4*10^9, your task is to find the smallest prime number which is not less than n.

输入

The first line of input will be a number specifying the number of lines that follow. Each of the following lines will be an integer n.

输出

For each of these lines, output the smallest prime not less than n, on a separate line.

样例输入 Copy

3
6
20
100

样例输出 Copy

7
23
101

来源/分类