TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
x = int(input())


def Eratosthenes(n):
    if n < 2:
        return None
    prime = [2]
    limit = math.ceil(n**0.5)
    data = list(range(3, n+1, 2))
    p = -1
    while p < limit:
        p = data[0]
        prime.append(p)
        data = [d for d in data if d%p != 0]
    return prime + data


prime = Eratosthenes(10**5+3)
if x in prime:
    print(x)
else:
    import bisect
    min_prime_index = bisect.bisect_right(prime, x)
    print(prime[min_prime_index])

import math

x = int(input())


def Eratosthenes(n):
    if n < 2:
        return None
    prime = [2]
    limit = math.ceil(n**0.5)
    data = list(range(3, n+1, 2))
    p = -1
    while p < limit:
        p = data[0]
        prime.append(p)
        data = [d for d in data if d%p != 0]
    return prime + data


prime = Eratosthenes(10**5+3)
if x in prime:
    print(x)
else:
    import bisect
    min_prime_index = bisect.bisect_right(prime, x)
    print(prime[min_prime_index])

Verdicts: Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
import math

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

X=int(input())

for i in range(X-1, 1000001):
  if is_prime(i):
    break
    
print(i)

import math
 
def is_prime(n):
    if n == 1: return False
 
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
 
    return True
 
X=int(input())
 
for i in range(X, 1000001):
  if is_prime(i):
    break
    
print(i)

Verdicts: Wrong Answer

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
def main():
    n = int(input())
    flg = False

    while not flg:
        if n == 2:
            print(n)
            exit()
        if n % 2 == 0:
            n += 1
            continue
        for i in range(3, n // 2 + 1, 2):
            if n % i == 0:
                n += 1
                continue
        print(n)
        exit()


if __name__ == '__main__':
    main()


def main():
    n = int(input())
    flg = False

    while not flg:
        if is_prime(n):
            print(n)
            exit()
        else:
            n += 1

def is_prime(num):
    if num == 2:
        return True
    if num % 2 == 0:
        return False
    for i in range(3, num // 2 + 1, 2):
        if num % i == 0:
            return False

    return True

if __name__ == '__main__':
    main()

Verdicts: Wrong Answer

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
def miller_rabin(n, k=-1):
    import random
    if n == 2:
        return True
    if n == 1 or n & 1 == 0:
        return False
    if k < 1:
        k = min(n - 1, 100)
    d = (n - 1) >> 1
    while d & 1 == 0:
        d >>= 1
    for a in random.sample(range(n), k):
        t = d
        y = pow(a, t, n)
        while t != n - 1 and y != 1 and y != n - 1:
            y = (y * y) % n
            t <<= 1
        if y != n - 1 and t & 1 == 0:
            return False
    return True
def main():
  x=int(input())
  for i in range(n+1,1000000):
    if miller_rabin(i):
      print(i)
      return
main()

def get_sieve_of_eratosthenes(n):
    prime = [2]
    limit = int(n ** 0.5)
    data = [i + 1 for i in range(2, n, 2)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]
print(get_sieve_of_eratosthenes(int(input())[-1])

def is_prime(n):
    for i in range(2, int(n**0.5)+1):
        if n % i == 0:
            return False
    return True
n=int(input())
while not is_prime(n):
  n+=1
print(n)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
X = int(input())

for i in range(X, 2 * X):
  flg = False
  for j in range(2, i-1):
    if X % j == 0:
      flg = True
    
  if flg == False:
    print(i)
    exit()

X = int(input())

flg = ''

for i in range(X, 2 * X):
  for j in range(2, i):
    if i % j == 0:
      break
    else:
      flg = True
      
  if flg == True:
    print(i)
    exit()

# ans

X = int(input())

while True:
  flg = True
  for i in range(2, X):
    if X % i == 0:
      flg = False
      X += 1
      break
      
  if flg == True:
    print(X)
    exit()

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
a=input()

def prime(n):
  for i in range(2,n):
    if n%i == 0:
      return False
    return True
  
while prime(a) == False:
  a += 1

print(a)
    

a=input()

def prime(n):
  if n <= 1:
    return False
  else:
    for i in range(2,n):
      if n%i == 0:
      	return False
      return True
    
while prime(a)==False:
  a += 1

print(a)

a=int(input())

def prime(n):
  if n <= 1:
    return False
  else:
    for i in range (2,n):
      if n%i == 0:
        return False
    return True
        
while prime(a)==False:
    a += 1

print(a)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
s = int(input())

def primeNumberCreate():
    global s
    primeList = [2]  
    maxNumber = s+1000 
    for x in range(s, maxNumber):
        for y in primeList:
            if x % y == 0:
                break
        else:
            primeList.append(x)  
    primeList.pop(0)
    return primeList

print(min(primeNumberCreate()))


def so(x):
	xx = int(x ** 0.5) + 1
	for i in range(2, xx):
		if x % i == 0:
			return True
	return False
    
x = int(input())
while(so(x)):
	x += 1
print(x)


Verdicts: Wrong Answer

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
import numpy as np
x=int(input())
a = 0
b = 0
while b == 0:
    s = int(np.sqrt(x))
    print(s,x)
    for i in range(s):
        if x % (i+2) == 0:
            a = 1
            x += 1
            break
    print(a)
    if a == 0:
        b = 1
    else:
        a = 0
print(x)

import numpy as np
x=int(input())
a = 0
b = 0
if x > 2:
    while b == 0:
        s = int(np.sqrt(x))
        for i in range(s):
            if x % (i+2) == 0:
                a = 1
                x += 1
                break
        if a == 0:
            b = 1
        else:
            a = 0
print(x)

Verdicts: Wrong Answer

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
X = int(input())

def is_Prime(x):
  for i in range(2, x+1):
    if i * i + 1 > x:
      return True
    if x % i == 0:
      return False

for i in range(X+1, 2X+1):
  if is_Prime(i):
    print(i)
    break

X = int(input())

def is_Prime(x):
  for i in range(2, x+1):
    if i * i + 1 > x:
      return True
    if x % i == 0:
      return False

for i in range(X, 2*X+1):
  if is_Prime(i):
    print(i)
    break


Verdicts: Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

x=int(readline())
def a(n):
  for i in range(2, int(n ** 0.5 + 1)):
    if n % i == 0:
      return False
  return True
  
  
n=x+1
while True:
  if a(n):
    pint(n)
    quit()
  n+=1

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

x=int(readline())
def a(n):
  for i in range(2, int(n ** 0.5 + 1)):
    if n % i == 0:
      return False
  return True
  

while True:
  if a(x):
    print(x)
    quit()
  x+=1

Verdicts: Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
import math
n = int(input())
c = n

def is_prime(n)
	for i in range(2, math.sqrt(n)+1):
    	if n % i == 0:
        	return False
    return True


while True:
  if is_prime(c):
    print(c)
    exit(0)
  else:
    c+=1

import math
n = int(input())
c = n


def is_prime(n):
    for i in range(2, int(math.sqrt(n)+1)):
        if n % i == 0:
            return False
    return True


while True:
    if is_prime(c):
        print(c)
        exit(0)
    else:
        c+=1


Verdicts: Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
x = int(input())

import bisect

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

primess = primes(x)
index = bisect.bisect_left(primess,x)
print(primess[index])

x = int(input())

from bitarray import bitarray
import bisect

def index_to_number(i): return 2*i+3
def number_to_index(n): return (n-3)//2

LIMIT_NUMBER = 50
LIMIT_INDEX = number_to_index(LIMIT_NUMBER)+1

odd_primes = bitarray(LIMIT_INDEX)
# index  0 1 2 3
# number 3 5 7 9

odd_primes.setall(True)

for i in range(LIMIT_INDEX):
    if odd_primes[i] is False:
        continue
    n = index_to_number(i)
    for m in range(n**2, LIMIT_NUMBER, 2*n):
        odd_primes[number_to_index(m)] = False

primes = [index_to_number(i) for i in range(LIMIT_INDEX)
          if odd_primes[i] is True]
primes.insert(0,2)

index = bisect.bisect_left(primes,x)
print(primes[index])

x = int(input())

import bisect

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

primess = primes(100010)
idx = bisect.bisect_left(primess,x)
print(primess[idx])

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
import math
 
x = int(input())

if x == 2:
    print(2)
    exit()
 
while True:
    g = math.ceil(math.sqrt(x))
    for i in range(2,g+1):
        if x%i == 0:
            f = False
            break
    if f == True:
        print(x)
        exit()
    x += 1

import math
 
x = int(input())
f = True
if x == 2:
    print(2)
    exit()
 
while True:
    g = math.ceil(math.sqrt(x))
    for i in range(2,g+1):
        if x%i == 0:
            f = False
            break
    if f == True:
        print(x)
        exit()
    x += 1

import math
 
x = int(input())

if x == 2:
    print(2)
    exit()
 
while True:
    f = True
    g = math.ceil(math.sqrt(x))
    for i in range(2,g+1):
        if x%i == 0:
            f = False
            break
    if f == True:
        print(x)
        exit()
    x += 1

Verdicts: Runtime Error

Time Limit Exceeded

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
import math
import random

def is_prime3(q,k=50):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False

    d = (q-1)>>1
    while d&1 == 0:
        d >>= 1
    
    for i in xrange(k):
        a = random.randint(1,q-1)
        t = d
        y = pow(a,t,q)
        while t != q-1 and y != 1 and y != q-1: 
            y = pow(y,2,q)
            t <<= 1
        if y != q-1 and t&1 == 0:
            return False
    return True


a = int(input())
while True:
 if is_prime3(a) == 1:
  break
 a = a + 1

print(a)



import math
import random

def is_prime3(q,k=50):
    q = abs(q)
    
    if q == 2: return True
    if q < 2 or q&1 == 0: return False

    
    d = (q-1)>>1
    while d&1 == 0:
        d >>= 1
    
    
    for i in xrange(k):
        a = random.randint(1,q-1)
        t = d
        y = pow(a,t,q)
        
        while t != q-1 and y != 1 and y != q-1: 
            y = pow(y,2,q)
            t <<= 1
        if y != q-1 and t&1 == 0:
            return False
    return True


a = int(input())
while True:
 if is_prime(a) == 1:
  break
 a = a + 1

print(a)



x = int(input())
def isPrime(n):
 cnt = 0
 for i in range(1, n + 1):
  if n % i == 0:
   cnt += 1
 if cnt == 2:
  return True
 else:
  return False
   
while True:
 if isPrime(x):
  print(x)
  break
 else:
  x += 1








Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
n=int(input())
if n == 2:
    print(n)
for p in range(2, 100000):
    if n % p != 0:
        print(n)
        break

    else:
       n=n+1

x=int(input())
def prime(n):
    for i in range(2, 100000):
        if n % i == 0:
            return False
        else:
            return True
while prime(x) == False:
    x += 1
print(x)

n=int(input())
for p in range(2, n):
    if n % p != 0:
        print(n)
        break
    else:
       n=n+1

n=int(input())
for p in range(2, 10000):
    if n % p != 0:
        print(n)
        break
    else:
       n=n+1

import math

x=int(input())
def prime(n):
    for i in range(2, int(math.sqrt(n)) + 1):
        if n % i == 0:
            return False

    return True

while prime(x) == False:
    x += 1
print(x)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
x = int(input())
cnt = 0
y = x
while 1:  
  for i in range(1,y+1):
    if y % i == 0:
      cnt += 1
  if cnt == 2:
    print(y)
    break
  else:
    y += 1


      
  

x = int(input())
cnt = 0
while True:
  for i in range(1,x+1):
    if x % i == 0:
      cnt += 1
  if cnt == 2:
    print(x)
    break
  else:
    x += 1

x = int(input())
done = True
while done :
    for i in range(2,x):
        if x % i == 0:
            x += 1
            break
    else:
        print(x)
        done = False
        

Verdicts: Time Limit Exceeded

Time Limit Exceeded

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
num, found = int(input()), False
def checkPrime(n):
    for x in (2, n):
        if n%x == 0:
            return False
            break
        else: return True
while not found:
    num += 1
    if checkPrime(num):
        found = True
        print(num)

def check(num):
    if num > 1:
        for i in range(2, num):
            if (num % i) == 0:
                return False
                break
        else:
            return True
    else:
        return False


a = int(input())

for i in range(a, 100500):
    if check(i):
        print(i)
        break

Verdicts: Wrong Answer

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):


using namespace std;

bool is_prime(long long x) {
  for (long long i = 2; i*i <= x; i++) {
    if (x % i == 0) { return false; }
  }
  return x != 1;
}

int main() {
  int x; cin >> x;

  for (int i = x; ; i++) {
    if (is_prime(i)) {
      cout << i << endl;
      return 0;
    }
  }
  return 0;
}

def is_prime(x):
    i = 2
    while i*i <= x:
        if x%i == 0: return False
        i += 1
    return x != 1


x = int(input())
while True:
    if is_prime(x):
        print(x)
        break
    x += 1

Verdicts: Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
def check(num):
    if num > 1:
        for i in range(2,num):
            if (num % i) == 0:
                return True           
            else:
                return False
    else:
        return True

x = int(input())
while check(x):
    x += 1
print(x)

def isPrime(n) : 
    if (n <= 1) : 
        return False
    if (n <= 3) : 
        return True
    if (n % 2 == 0 or n % 3 == 0) : 
        return False
    i = 5
    while(i * i <= n) : 
        if (n % i == 0 or n % (i + 2) == 0) : 
            return False
        i = i + 6
    return True

x = int(input())
while isPrime(x)==False:
    x += 1
print(x)

Verdicts: Wrong Answer

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
from math import sqrt, floor

# x = int(input())
x = 99992


def is_prime(x: int) -> bool:
    if x <= 1:
        return False

    for i in range(2, floor(sqrt(x))):
        if x % i == 0:
            return False

    return True


while not is_prime(x):
    x += 1

print(x)


from math import sqrt, floor

def is_prime(x: int) -> bool:
    if x <= 1:
        return False

    for i in range(2, floor(sqrt(x))):
        if x % i == 0:
            return False

    return True


x = int(input())
while not is_prime(x):
    x += 1
print(x)


Verdicts: Wrong Answer

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
n = int(input())

if n != 2:
    if n % 2 == 0:
        n += 1
    for p in range(n, 10**5, 2):
        if is_prime(p):
            print(p)
            break
else:
    print(n)

def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1

n = int(input())

if n % 2 == 0:
    n += 1
while not is_prime(n):
    n += 2
print(n)

def is_prime(q):
    if q == 2: return True
    if q < 2 or q&1 == 0: return False

    d = (q-1)>>1
    while d&1 == 0:
        d >>= 1
    
    for i in xrange(k):
        a = random.randint(1,q-1)
        t = d
        y = pow(a,t,q)
        while t != q-1 and y != 1 and y != q-1: 
            y = pow(y,2,q)
            t <<= 1
        if y != q-1 and t&1 == 0:
            return False
    return True

n = int(input())

if n != 2:
    if n % 2 == 0:
        n += 1
    while not is_prime(n):
        n += 2
    print(n)
else:
    print(n)

def is_prime(q):
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1

n = int(input())

if n != 2:
    if n % 2 == 0:
        n += 1
    while not is_prime(n):
        n += 2
    print(n)
else:
    print(n)

def is_prime(q):
    if q == 2: return True
    if q < 2 or q&1 == 0: return False

    d = (q-1)>>1
    while d&1 == 0:
        d >>= 1
    
    for i in xrange(k):
        a = random.randint(1,q-1)
        t = d
        y = pow(a,t,q)
        while t != q-1 and y != 1 and y != q-1: 
            y = pow(y,2,q)
            t <<= 1
        if y != q-1 and t&1 == 0:
            return False
    return True

def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            return False
    return True

if __name__ == '__main__':
    n = int(input())
    while not is_prime(n):
        n += 1
    print(n)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
a=int(input())
if a==2:
  print(a)
else:
  sosuu=1
  a=a-1
  while sosuu==1:
    a+=1
    b=2
    while a!=b:
      sosuu=0
      if a%b==0:
        sosuu=1//割り切れた
        break
      else:
        b+=1
  print(a)

a=int(input())
if a==2:
  print(a)
else:
  sosuu=1
  a=a-1
  while sosuu==1:
    a+=1
    b=2
    while a!=b:
      if a%b==0:
        sosuu=1
        break
      else:
        b+=1
        sosuu=0
  print(a)

Verdicts: Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
def is_prime(x):
    n = math.floor(math.sqrt(x))
    for i in range(2,n+1):
        if x % i == 0:
            return False
    return True            
a = int(input())
while not(is_prime(a)):
    a += 1    
print(a)

import math
def is_prime(x):
    n = math.floor(math.sqrt(x))
    for i in range(2,n+1):
        if x % i == 0:
            return False
    return True            
a = int(input())
while not(is_prime(a)):
    a += 1    
print(a)


Verdicts: Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
n = int(input())

def isprime(x):
    if x == 2:
        return True
    for i in range(3, int(x**0.5), 2):
        if x % i == 0:
            return False
    return True

i = n
while True:
    if isprime(i):
        break
    else:
        i += 1
print(i)

n = int(input())

def isprime(x):
    if x == 2:
        return True
    elif x == 4:
        return False
    for i in range(3, int(x**0.5), 2):
        if x % i == 0:
            return False
    return True

i = n
while True:
    if isprime(i):
        break
    else:
        i += 1
print(i)

n = int(input())

def isprime(x):
    for i in range(2, int(x**0.5), 1):
        if x % i == 0:
            return False
    return True

i = n
while True:
    if isprime(i):
        break
    else:
        i += 1
print(i)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
X=int(input())
for j in range(X,10**5+1):
    for i in range(X-1,0,-1):
        if j%i==0:
            break
        elif i==1:
            print(j)
            exit()

X=int(input())
x=0
for j in range(X,10**6):
    for i in range(j-1,0,-1):
        if i==1:
            print(j)
            x=1
        elif j%i==0:
            break
    if x==1:
        break

Verdicts: Wrong Answer

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
import fractions

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(fractions.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

X = int(input())

if is_prime(X):
    print(X)
    exit()
if X % 2 == 0:
    X += 1
while (1):
    if is_prime(X):
        print(X)
        break
    X += 2

def sqrt(x):
    return x ** (.5)

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

X = int(input())

if is_prime(X):
    print(X)
    exit()
if X % 2 == 0:
    X += 1
while (1):
    if is_prime(X):
        print(X)
        break
    X += 2

Verdicts: Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
def is_prime(n):
    i=1
    while i*i<n:
        if n%i==0:
            return False
        i+=1
    return True 

n=int(input())+1
while not is_prime(n):
    n+=1
print(n)

def is_prime(n):
    i=2
    while i*i<n:
        if n%i==0:
            return False
        i+=1
    return True 

n=int(input())
while not is_prime(n):
    n+=1
print(n)

Verdicts: Time Limit Exceeded

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
import math
def is_prime(n):
    if n == 1: return False
    for k in range(2, int(math.sqrt(n))+1):
        if n % k == 0:
            return False
        return True

X=int(input())

p = X
while(not is_prime(p)):
    p += 1
print(p)

import math
def is_prime(n):
    if n == 1: return False
    for k in range(2, int(math.sqrt(n))+1):
        if n % k == 0:
            return False
    return True


X=int(input())

p = X
while(not is_prime(p)):
    p += 1
print(p)

Verdicts: Wrong Answer

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
X = int(input())
def is_prime(x):
    flag = True
    for i in range(2,int(x**(0.5))+1):
        if x % i == 0:
            flag = False
    return flag
for i in range(X,2*X+1):
    if is_prime(X):
        print(i)
        break

X = int(input())
def is_prime(x):
    flag = True
    for i in range(2,int(x**(0.5))+1):
        if x % i == 0:
            flag = False
    return flag
for i in range(X,2*X+1):
    if is_prime(i):
        print(i)
        break

Verdicts: Wrong Answer

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
a = int(input())

def factorization(n):
    arr = []
    tmp = n

    for i in range(2, int(n**0.5//1)+1):
        if tmp%i==0:
            cnt = 0
            while tmp%i==0:
                cnt+=1
                tmp//=i
            arr.append([i,cnt])
    if tmp!=1:
        arr.append([tmp,1])
    if arr==[]:
        arr.append([n,1])
    return arr

while True:
  arr = factorization(a)
  if (len(arr)==1) & (arr[1]==1):
    print(a)
    break
  a+=1

a = int(input())

def factorization(n):
    arr = []
    tmp = n

    for i in range(2, int(n**0.5//1)+1):
        if tmp%i==0:
            cnt = 0
            while tmp%i==0:
                cnt+=1
                tmp//=i
            arr.append([i,cnt])
    if tmp!=1:
        arr.append([tmp,1])
    if arr==[]:
        arr.append([n,1])
    return arr

while True:
  arr = factorization(a)
  if (len(arr)==1) & (arr[0][1]==1):
    print(a)
    break
  a+=1


Verdicts: Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
def factors(n):
    return [i for i in range(2, n) if n % i == 0]


X = int(input())

prime_l = factors(X)
while True:
    for i in prime_l:
        if X % i == 0:
            break
    prime_l.append(X)
    X += 1
print(X)


def is_prime(n):
    if n < 2 or n&1 == 0:
        return False
    for i in range(2, n):
        if i*i > n or n % i == 0:
            return False
    return True


X = int(input())

while not is_prime(X):
    X += 1
print(X)


def is_prime(n, k=100):
    n = abs(n)
    if n == 2:
        return True
    if n < 2 or n&1 == 0:
        return False
    for i in xrange(3, k):
        x, y = n, i
        while y:
            x, y = y, x%y
        if x != 1:
            continue
        if pow(2, n-1, n) != 1:
            return False
    return True


X = int(input())

while True:
    if is_prime(X):
        print(X)
        break
    X += 1


import random


def is_prime3(q, k=50):
    q = abs(q)
    if q == 2:
        return True
    if q < 2 or q & 1 == 0:
        return False

    
    d = (q-1) >> 1
    while d & 1 == 0:
        d >>= 1

    
    for i in range(k):
        a = random.randint(1, q-1)
        t = d
        y = pow(a, t, q)
        
        while t != q-1 and y != 1 and y != q-1:
            y = pow(y, 2, q)
            t <<= 1
        if y != q-1 and t & 1 == 0:
            return False
    return True


X = int(input())

while not is_prime3(X):
    X += 1

print(X)

Verdicts: Time Limit Exceeded

Time Limit Exceeded

Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
import math
n = int(input())
div = math.floor(math.sqrt(n))
while True:
  for i in range(2,div+1):
    if i == div+1:
      ans = n
      break
    if n%i==0:
      n+=1
      break
  break
print(ans)

import math
n = int(input())
div = math.floor(math.sqrt(n))
def sosu(n):
    if n <= 1:
        return False
    for i in range(2,div+1):
        if n%i==0:
            return False
    return True
while True:
    if sosu(n):
        print(n)
        break
    else:
        n+=1

Verdicts: Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
dp = [0 for i in range(1000000)]
N = int(input())
for i in range(2,N):
  if i**2>N:
    break
  if dp[i]!=0:
    continue
  for j in range(i,N,i):
    dp[j] = 1
while dp[N]!=0:
  N += 1
print(N)
    

dp = [0 for i in range(1000000)]
N = int(input())
for i in range(2,1000):
  if i**2>N:
    break
  if dp[i]!=0:
    continue
  for j in range(i,1000000,i):
    dp[j] = 1
while dp[N]!=0:
  N += 1
print(N)

Verdicts: Wrong Answer

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
X=int(input())
import sys
for i in range(X,10**5+1000):
  T=True
  for j in range(2,i):
    if i%j==0:
      T=False
  if T==True:
    print(i)
    break
  else:
    print(1)
    continue

X=int(input())
import sys
for i in range(X,10**5+1000):
  T=True
  for j in range(2,i):
    if i%j==0:
      T=False
  if T==True:
    print(i)
    break
  else:
    continue

Verdicts: Wrong Answer

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
import sys
x=int(input())
n = x
primes = set(range(2, n+1))
for i in range(2, int(n**0.5+1)):
    primes.difference_update(range(i*2, n+1, i))
primes=list(primes)

if x==1 or 2:
    print(2)
    sys.exit()
if x%2==0:
    x=x+1
while True:
    if all(x%i!=0 for i in primes):
        print(x)
        sys.exit()
    else:
        x=x+2

import sys
x=int(input())
n = x
primes = set(range(2, n+1))
for i in range(2, int(n**0.5+1)):
    primes.difference_update(range(i*2, n+1, i))
primes=list(primes)
if x in primes:
    del primes[-1]
if x==2:
    print(2)
    sys.exit()
if x%2==0:
    x=x+1
while True:
    if all(x%i!=0 for i in primes):
        print(x)
        sys.exit()
    else:
        x=x+2

Verdicts: Wrong Answer

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
X = int(input())
for i in range(X+1, 9999999999999999):
    flag = 1
    for j in range(2, X//2 +1):
        if i % j == 0:
            flag = -1
            break
    # if X == 2:
    #     print(2)
    #     break
    # elif X == 3:
    #     print(3)
    #     break
    elif flag == 1:
        print(i)
        break

X = int(input())
for i in range(X, 9999999999999999):
    flag = 1
    for j in range(2, X//2 +1):
        if i % j == 0:
            flag = -1
            break
    if X == 2:
        print(2)
        break
    elif X == 3:
        print(3)
        break
    elif flag == 1:
        print(i)
        break

Verdicts: Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
import math
def is_prime(n):
    if n == 1:
        return False
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True
    
x = int(input())
for i in range(x, 2*x:
    if is_prime(i):
        print(i)
        break

import math
def is_prime(n):
    if n == 1:
        return False
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True
    
x=int(input())
for i in range(x, 2*x):
    if is_prime(i):
        print(i)
        break

Verdicts: Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
X = int(input())
result = []
i = X
while i >= X:
    i += 1
    if i > 1:
        for j in range (2, i):
            if (i % j) == 0:
                break
        else:
            result.append(i)
print (min(result))

X = int(input())
result = []
i = X
while i >= X:
    for j in range (2, i):
        if (i % j) == 0:
            break
    else:
            result.append(i)
    i += 1
print (min(result))

X = int(input())
result = []
for i in range(X,X*2):
    for j in range (2,i):
        if (i % j) == 0:
            break
    else:
            result.append(i)
            a = i
            break
print (a)

Verdicts: Time Limit Exceeded

Time Limit Exceeded

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
import math

X = int(input())
X_sqrt = int(math.sqrt(X))

flag = 0
while flag == 0:
  if X >= 10**5 + 3:
    print("big")
    break
    
  flag = 1
  for i in range(2, X_sqrt):
    if X % i == 0:
      flag = 0
      break
  
  if flag == 1:
    print(X)
    break

import math

X = int(input())
X_sqrt = int(math.sqrt(X))

flag = 0
while flag == 0:
  if X >= 10**6:
    print("big")
    break
    
  flag = 1
  for i in range(2, X_sqrt):
    if X % i == 0:
      flag = 0
      break
  
  if flag == 1:
    print(X)
    break

import math

X = int(input())

flag = 1
while True:
  i = 2
  flag = 1
  while i * i <=  X:
    if X % i == 0:
      flag = 0
      break
    i += 1
  
  if flag == 1:
    print(X)
    break
    
  X += 1

Verdicts: Time Limit Exceeded

Time Limit Exceeded

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
X = int(input())

def check(num):
    max_div = int(num**0.5)
    for div in range(2, max_div+1):
        if num % div == 0:
            return False
    else:
        return True

num = X
while True:
    if check(num):
    print(num)
    break
    
    num += 1

X = int(input())

def check(num):
    max_div = int(num**0.5)
    for div in range(2, max_div+1):
        if num % div == 0:
            return False
    else:
        return True

num = X
while True:
    if check(num):
        print(num)
        break
    
    num += 1

Verdicts: Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
x=int(input())

def is_prime(c):
  for i in range(2,int(c**(1/2))+2):
    if c%i!=0:
      return False
  return True

for i in range(x,10004):
  if is_prime(i):
    print(i)
    break

   

x=int(input())

def is_prime(c):
  for i in range(2,int(c**(1/2))+2):
    if c%i!=0:
      return False
  return True

for i in range(x,10004):
  if is_prime(i):
    print(i)
    break
  else:
    i+=1
    

   

x=int(input())

def is_prime(c):
  for i in range(2,int(c**(1/2))+2):
    if c%i==0 and c!=2:
      return False
  return True

for i in range(x,100004):
  if is_prime(i)==False:
    pass
  else:
    print(i)
    break
    

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
def main():
    n = input('Find the next prime number greater great than: ')
    print find_next_prime(n+1)

def find_next_prime(n):
    return find_prime_in_range(n, 2*n)

def find_prime_in_range(a, b):
    for p in range(a, b):
        for i in range(2, p):
            if p % i == 0:
                break
        else:
            return p
    return None

if __name__ == '__main__':
    main()

import math 
def isPrime(n):
    if n == 1:
        return False
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True
def nextPrime(N):
    if N <= 1:
        return 2
    prime = N
    found = False
    while(not found): 
        prime = prime + 1
        if(isPrime(prime) == True): 
            found = True
    return prime 
A = int(input())
N = A-1
print(nextPrime(N)) 

Verdicts: Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
X = map(int, input().split())

number = X
flag = 0

if(number%2 == 0):
    number += 1
else:
    pass

while(True):
    for i in range(2, number):
        if number%i == 0:
            number += 2
            break

        elif i == (number-1):
            flag = 1
            print(number)
            break

        else:
            pass

    if flag == 1:
        break


import argparse
import itertools

def make_parser():
    parser = argparse.ArgumentParser()

    parser.add_argument('X', type=int)
    args = parser.parse_args()

    return args

def main():
    args = make_parser()
    number = args.X
    flag = 0

    if(number%2 == 0):
        number += 1
    else:
        pass

    while(True):
        for i in range(2, number):
            if number%i == 0:
                number += 2
                break

            elif i == (number-1):
                flag = 1
                print(number)
                break

            else:
                pass

        if flag == 1:
            break


if __name__ == "__main__":
    main()


X = int(input())

number = X
flag = 0

if number == 2:
  	print(number)
elif number%2 == 0:
    number += 1
else:
    pass
  
if number != 2:
    while(True):
        for i in range(2, number):
            if number%i == 0:
                number += 2
                break

            elif i == (number-1):
                flag = 1
                print(number)
                break

            else:
                pass

        if flag == 1:
            break

else:
  pass

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

x = int(input())  
  
while not is_prime(x):
  x+=1
  
print(x)  

import math

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

x = int(input())  
  
while not is_prime(x):
  x+=1
  
print(x)  

Verdicts: Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
def prm(x):
  if x == 1 or x == 4:
    return False
  for i in range(1,int(x**0.5+1)):
    if x%i == 0:
      return False
  return True
for i in range(X,X**2):
  if prm(i):
    print(i)
    break

def prm(x):
  if x == 1 or x == 4:
    return False
  for i in range(1,int(x**0.5+1)):
    if x%i == 0:
      return False
  return True
X=int(input())
for i in range(X,X**2):
  if prm(i):
    print(i)
    break

def prm(x):
  if x == 1 or x == 4:
    return False
  for i in range(1,int(i**0.5+1)):
    if x%i == 0:
      return False
  return True
for i in range(X,X**2):
  if prm(i):
    print(i)
    break

def prm(x):
  if x == 1 or x == 4:
    return False
  for i in range(2,int(x**0.5+1)):
    if x%i == 0:
      return False
  return True
X=int(input())
for i in range(X,X**2):
  if prm(i):
    print(i)
    break

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
n = int(input())
 
def p(x):
  if x == 2:
    return True
  for i in range(x//2):
    if x % i == 0:
      return False
  return True
 
for i in range(n,2*n):
  if p(i):
    print(i)
    break

n = int(input())
 
def p(x):
  if x == 2:
    return True
  for i in range(x/2):
    if x % i == 0:
      return False
  return True
 
for i in range(n,2*n):
  if p(i):
    print(i)
    break


n = int(input())

def p(x):
  if x == 2:
    return True
  for i in range(x/2):
    if x % i == 0:
      return False
  return True

for i in range(x,2*x):
  if p(i):
    print(i)
    break

n = int(input())
 
def p(x):
  if x == 2:
    return True
  for i in range(2,x//2):
    if x % i == 0:
      return False
  return True
 
for i in range(n,2*n):
  if p(i):
    print(i)
    break

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
x = int(input())
primes = []
n = 2


def is_prime(num):
    for p in primes:
        if num % p == 0:
            return False
        if p * p > num:
            return True
    return True


while True:
    if is_prime(n):
        if n >= x:
            print(n)
            exit()
        else:
            print('{}: {}'.format(len(primes), n))
            primes.append(n)
    n += 1

x = int(input())
primes = []
n = 2

def is_prime(num):
  for p in primes:
    if num % p == 0:
      return False
  return True

while true:
  if is_prime(n):
    if n >= x:
      print(n)
      exit()
    else:
      primes.append(n)
  n += 1
  

x = int(input())
primes = []
n = 2


def is_prime(num):
    for p in primes:
        if num % p == 0:
            return False
        if p * p > num:
            return True
    return True


while True:
    if is_prime(n):
        if n >= x:
            print(n)
            exit()
        else:
            primes.append(n)
    n += 1

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
import sys
sys.path.append('../../')
from librarys import prime_factorization

x = int(input())

while(True):
    p = prime_factorization.factorization(x)
    if len(p)==1:
        break
    else:
        x += 1

print(x)



def factorization(n):
    arr = {}
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr[i] = cnt

    if temp!=1:
        arr[temp]=1

    if arr==[]:
        arr[n] = 1

    return arr

x = int(input())
print(factorization(x))
while(True):
    p = factorization(x)
    if (len(p)==1) & (x in p):
        print(p)
        break
    else:
        x += 1

print(x)

def factorization(n):
    arr = {}
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr[i] = cnt

    if temp!=1:
        arr[temp]=1

    if arr==[]:
        arr[n] = 1

    return arr



x = int(input())
while(True):
    p = factorization(x)
    if (len(p)==1) & (x in p):
        break
    else:
        x += 1

print(x)


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
X = int(input())
def sosu(n):
  for i in range(2,n//2):
    if X % i == 0:
      return False
    return True
if X == 2:
  print(2)
else:
  while sosu(X) == False:
    X += 1
  print(X)


X = int(input())
def sosu(n):
  for i in range(2,n//2):
    if n % i == 0:
      return False
    return True
if X == 2:
  print(2)
else:
  while sosu(X) == False:
    X += 1
  print(X)


X = int(input())
def sosu(n):
  for i in range(2,n//2 + 1):
    if n % i == 0:
      return False
    return True
if X == 2:
  print(2)
else:
  while sosu(X) == False:
    X += 1
  print(X)


X = int(input())
def isPrime(N):
  for i in range(2, ceil(N ** (1/2)):
    if N % i == 0:
      return False
  return True
while isPrime(X) == False:
  X += 1
print(X)

X = int(input())
def sosu(n):
  for i in range(2,n):
    if n % i == 0:
      return False
    return True
if X == 2:
  print(2)
else:
  while sosu(X) == False:
    X += 1
  print(X)


X = int(input())
def sosu(n):
  for i in range(0,n//2):
    if X % i == 0:
      return False
    return True
if sosu(X) == True :
  print(X)
else:
  while sosu(X) == False:
    X += 1
  print(X)

X = int(input())
def sosu(n):
  for i in range(2,n):
    if X % i == 0:
      return False
    return True
if X == 2:
  print(2)
else:
  while sosu(X) == False:
    X += 1
  print(X)


import math
X = int(input())
def isPrime(N):
  for i in range(2, math.ceil(math.sqrt(X))):
    if N % i == 0:
      return False
  return True
while isPrime(X) == False:
  X += 1
print(X)


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
import sys

def main():
    

    x = int(input())

    r = false
    while not r:
        r = true
        for i in range(2,x):
            if x % i == 0:
                r = false
                break

        if r == false:
            x += 1
        
    print(x)

if __name__ == '__main__':
    main()


import sys

def main():
    

    x = int(input())

    r = false
    while not r:
        r = true
        for i in range(2,x):
            if x % i == 0:
                r = false
                break

        if r == false:
            x += 1
        
    print(x)

if __name__ == '__main__':
    main()


import sys

def main():
    

    x = int(input())

    r = False
    while not r:
        r = True
        for i in range(2,x):
            if x % i == 0:
                r = False
                break

        if r == False:
            x += 1
        
    print(x)

if __name__ == '__main__':
    main()


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
import numpy as  np
import math
 
def get_sieve_of_eratosthenes(n):
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]
 
 
x = int(input())
data = get_sieve_of_eratosthenes(x+100000000)
data = np.array(data)
indices = np.where(data > x)[0]

print(data[indices[0]])
 

import numpy as  np
import math

def get_sieve_of_eratosthenes(n):
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]


x = int(input())
data = get_sieve_of_eratosthenes(x+100)
data = np.array(data)
indices = np.where(data >= x)[0]

print(data[indices[0]])



Verdicts: Time Limit Exceeded

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
import sys
import bisect
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

n = int(read())
n *= 10

primes = set(range(2, n+1))
for i in range(2, int(n**0.5+1)):
    primes.difference_update(range(i*2, n+1, i))
primes=list(primes)

idx = bisect.bisect_left(primes, n //2)


print(primes[idx])


import sys
import math
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

n = int(read())

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


for i in range(n, n*n, 1):
    if is_prime(i):
        break

print(i)

Verdicts: Wrong Answer

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
import math

x = int(input())

def is_prime(n):
  for i in range(int(math.sqrt(n))):
    if(n%i==0):
      return False
  return True

for i in range(x, x+100):
  if is_prime(i):
    print(i)
    exit()

a,b,k = map(int, input().split())

if(a<k):
  k -= a
  a = 0
else:
  tmp = k
  k -= a
  a -= tmp
  
if(b<k):
  b = 0
else:
  b -= k

print("{0} {1}".format(a,b))

import math

x = int(input())

def is_prime(n):
  for i in range(2, int(math.sqrt(n))):
    if(n%i==0):
      return False
  return True

for i in range(x, x+100):
  if is_prime(i):
    print(i)
    exit()

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):

# https://qiita.com/takayg1/items/3769ab4cc62a231f4259

def eratosthenes_sieve(n):
    is_prime = [True]*(n + 1)
    is_prime[0] = is_prime[1] = False
    for p in range(2, n + 1):
        if is_prime[p]:
            for q in range(2*p, n + 1, p):
                is_prime[q] = False
    return is_prime

MAX_N=(10**6)
Primes = eratosthenes_sieve(MAX_N)

x = int(input())
while True:
    if Primes[x]:
        print(x)
        exit()


# https://qiita.com/takayg1/items/3769ab4cc62a231f4259

def eratosthenes_sieve(n):
    is_prime = [True]*(n + 1)
    is_prime[0] = is_prime[1] = False
    for p in range(2, n + 1):
        if is_prime[p]:
            for q in range(2*p, n + 1, p):
                is_prime[q] = False
    return is_prime

MAX_N=(10**6)
Primes = eratosthenes_sieve(MAX_N)

x = int(input())
while True:
    if Primes[x]:
        print(x)
        exit()
    x += 1

Verdicts: Time Limit Exceeded

Accepted
Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
# -*- coding:utf-8 -*-
import numpy as np

x = int(input())
num = [i for i in range(2, 100010)]
#print(num)

np_x = np.array(num)

for i in range(2, 100010):
    b = np.logical_or(np_x == i, np_x%i != 0)
    np_x = np_x[b]
#print(np_x)

ans = np_x[np_x >= x]
#print(ans)
print(ans[0])




# -*- coding:utf-8 -*-
import math

def is_prime(N):
    if N == 1:
        return False
    for k in range(2, int(math.sqrt(N))+1):
        if N%k == 0:
            return False
    return True

X = int(input())

while True:
    if is_prime(X):
        print(X)
        exit()
    X += 1
    


Verdicts: Time Limit Exceeded

Accepted