21538_NextPrime

2022-5-16 18:19| 发布者: Hocassian| 查看: 38| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-4-89505404687399-Problem List-采集的数据-后羿采集器.html

Pro.ID

21538

Title

Next Prime

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=21538

AC

4

Submit

22

Ratio

18.18%

时间&空间限制

  • Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    Given an integer n, with 0 ≤ n ≤ 4*109, 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.

    输出

    Description

    Given an integer n, with 0 ≤ n ≤ 4*109, your task is to find the smallest prime number which is not less than n.

    Input

    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.

    Output

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

    Sample Input

    3
    6
    20
    100

    Sample Output

    7
    23
    101

    Source

    样例输入

    3
    6
    20
    100

    样例输出

    7
    23
    101

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部