NOVICE24 - Problem 4

Given an integer N you have to find smallest prime number which comes after N, means smallest prime which is greater than N.

Input

First line contains T the number of test cases. Each of next T lines contain one integer N. 1<=N<=10^9

Output

For each test case print the answer in a new line.

Example

Input:
2
5
21

Output:
7
23

Added by:Mahesh Chandra Sharma
Date:2011-01-26
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM32-GCC GAWK MAWK BC C-CLANG NCSHARP CPP14 CPP14-CLANG COBOL COFFEE D-CLANG D-DMD DART ELIXIR FANTOM FORTH GOSU GRV JS-MONKEY JULIA KTLN NIM NODEJS OBJC OBJC-CLANG OCT PICO PROLOG PYPY PYPY3 PY_NBC R RACKET RUST CHICKEN SED SQLITE SWIFT UNLAMBDA VB.NET
Resource:NSIT Noivce contest #2

hide comments
2015-01-08 14:41:40 [Lakshman]
There is some issue with the IO file My haskell code is giving NZEC but accepted for similar problem (8360. Prime After N AU12)
2013-08-18 03:49:25 John and the cows
easy one :)
2011-02-17 17:55:38 Mahesh Chandra Sharma
There was a problem in the "checker" option. It has been fixed now!
2011-02-17 17:50:59 Knight
Plz check the judge ...
Its gone into for(;;) :P
2011-02-17 17:50:59 Robert Gerbicz
Is there input set for this problem?
2011-02-17 17:50:59 Mehul
There seems to be some "waiting" problem in Judge
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.