ZhenlongDai/ACPR huggingface dataset:
Problem: p02819
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
X = int(input())
for i in range(X+1, 999999999):
    flag = 1
    for j in range(2, X):
        if i % j == 0:
            flag = -12
            break
    if X == 2:
        print(2)
        break
    elif X == 3:
        print(3)
        break
    elif flag == 1:
        print(i)
        break

Failing test case input:
431

Expected output:
431


Actual output:
433


Fixed submission (verdict: Accepted):
X = int(input())
for i in range(X, 9999999999999999):
    flag = 1
    for j in range(2, X
        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

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

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

def prime(A):
  pn=[2]
  for L in range(3,A):
    chk=True
    for L2 in pn:
        if L%L2 == 0:chk=False
    if chk==True:pn.append(L)
  return pn

pm_list=prime(rt)

if X in pm_list:
  print(X)
else:
  get_pri=False
  N=X+1
  
  while get_pri==False:
    judge=True
    for i in pm_list:
    
      if N%i==0:
        judge=False
        continue
    if judge==True:
      get_pri=True
      print(N)
    N+=1

Failing test case input:
431

Expected output:
431


Actual output:
433


Fixed submission (verdict: Accepted):
import math

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

def prime(A):
  pn=[2]
  for L in range(3,A+1,2):
    chk=True
    for L2 in pn:
        if L%L2 == 0:chk=False
    if chk==True:pn.append(L)
  return pn

pm_list=prime(rt)


if X in pm_list:
  print(X)
else:
  get_pri=False
  N=X
  
  while get_pri==False:
    judge=True
    for i in pm_list:
    
      if N%i==0:
        judge=False
        continue
    if judge==True:
      get_pri=True
      print(N)
    N+=1

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())
while not all(x % i for i in range(2, x)):
    x += 1

Failing test case input:
5560

Expected output:
5563


Actual output:

Fixed submission (verdict: Accepted):
x = int(input())
while not all(x % i for i in range(2, x)):
    x += 1
print(x)

Problem: p02819
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
X = int(input())+1
def Sosuu_not(n):
  for p in range(2, n):
    if n % p == 0:
        return False
  else:
    return True
while True:
  if Sosuu_not(X) == True:
    print(X)
    break
  X += 1


Failing test case input:
997

Expected output:
997


Actual output:
1009


Fixed submission (verdict: Accepted):
X = int(input())
def Sosuu_not(n):
  for p in range(2, n):
    if n % p == 0:
        return False
  else:
    return True
while True:
  if Sosuu_not(X) == True:
    print(X)
    break
  X += 1
Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x=int(input())
import math
def is_prime(n):
    if n==1:
        return False
    for divisor in range(2,int(math.sqrt(n))+1):
        if n%divisor == 0:
            return False
    return True


for k in range(x,100001):
    if is_prime(k) == True:
        print(k)
        exit()
        
    

Failing test case input:
99992

Expected output:
100003

Actual output:

Fixed submission (verdict: Accepted):
x=int(input())
import math
def is_prime(n):
    if n==1:
        return False
    for divisor in range(2,int(math.sqrt(n))+1):
        if n%divisor == 0:
            return False
    return True

k=0
while True:
    if is_prime(x+k):
        print(x+k)
        break
    else:
        k += 1

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())

for i in range(10^5):
  n = 2
  while x % n != 0 and n <= x/2:
    n += 1
  if n < x/2:
    x += 1
    
  else:
    print(x)
    break
      

Failing test case input:
1955

Expected output:
1973


Actual output:

Fixed submission (verdict: Accepted):
x = int(input())

while True:
  n = 2
  while x % n != 0 and n <= x/2:
    n += 1
  if n < x/2:
    x += 1
    
  else:
    print(x)
    break

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X = int(input())

count = 0

for i in range(2, X+1, 1):
    if X % i == 0:
        count += 1
    
if count == 1:
    print(X)
else:
    while 1 > 2:
        count = 0
        X += 1
        for i in range(2, X+1, 1):
            if X % i == 0:
                count += 1
        if count == 1:
            print(X)
            break

Failing test case input:
2425

Expected output:
2437


Actual output:

Fixed submission (verdict: Accepted):
X = int(input())

count = 0

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

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from math import sqrt


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


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


Failing test case input:
892

Expected output:
907


Actual output:
899


Fixed submission (verdict: Accepted):
from math import sqrt


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


X = int(input())
while True:
    if is_prime(X):
        print(X)
        break
    X += 1
Problem: p02819
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
x=int(input())
def eratosthenes(n):
  l0=list(range(2,n+1))
  l1=[1]*(n+1)
  l1[0]=0
  l1[1]=0
  for li in l0:
    if li>int(n**0.5):
      break
    if l1[li]==1:
      k=2
      while k*li<=n:
        l1[k*li]=0
        k+=1
  ret=[i for i,li in enumerate(l1) if li==1]
  return ret
a=eratosthenes(x)
while True:
  flg=True
  for ai in a:
    if x%ai==0:
      flg=False
      break
  if flg:
    print(x)
    exit()
  x+=1


Failing test case input:
4751

Expected output:
4751


Actual output:
4759


Fixed submission (verdict: Accepted):
x=int(input())
def eratosthenes(n):
  l0=list(range(2,n+1))
  l1=[1]*(n+1)
  l1[0]=0
  l1[1]=0
  for li in l0:
    if li>int(n**0.5):
      break
    if l1[li]==1:
      k=2
      while k*li<=n:
        l1[k*li]=0
        k+=1
  ret=[i for i,li in enumerate(l1) if li==1]
  return ret
a=eratosthenes(x)
if x in a:
  print(x)
  exit()
while True:
  flg=True
  for ai in a:
    if x%ai==0:
      flg=False
      break
  if flg:
    print(x)
    exit()
  x+=1

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = input()

def is_sosu(num):
  st = 2
  while True:
    if num % st == 0:
      print(num)
      return
    st += 1
    if st == num:
      break
  is_sosu(num+1)

is_sosu(int(x))

Failing test case input:
838

Expected output:
839


Actual output:
838


Fixed submission (verdict: Accepted):
x = input()

def is_sosu(num):
  st = 2
  while True:
    if num % st == 0:
      break
    st += 1
  if st == num:
    print(num)
    return
  is_sosu(num+1)

is_sosu(int(x))

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

def getPrimes(X):
    primes = []
    limit = math.sqrt(X)
    data = [i + 1 for i in range(1, X)]
    while True:
        p = data[0]
        if limit <= p:
            return primes + data
        primes.append(p)
        data = [d for d in data if d % p != 0]

def getNextPrime(primes, X):
    while True:
        if any([X % p == 0 for p in primes]):
            X += 1
        else:
            return X
        
        
X = int(input())
primes = getPrimes(X)
print(getNextPrime(primes, X))

Failing test case input:
433

Expected output:
433


Actual output:
439


Fixed submission (verdict: Accepted):
import math

def getPrimes(X):
    primes = []
    limit = math.sqrt(X)
    data = [i + 1 for i in range(1, X)]
    while True:
        p = data[0]
        if limit <= p:
            return primes + data
        primes.append(p)
        data = [d for d in data if d % p != 0]

def getNextPrime(primes, X):
    while True:
        if any([X % p == 0 for p in primes]):
            if primes[-1] == X:
                return X
            X += 1
        else:
            return X
        
        
X = int(input())
primes = getPrimes(X)
print(getNextPrime(primes, X))
Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
x = int(input())

if x == 2 or x == 3:
    print(x)
    sys.exit()

for i in range(10):

    for j in range(2, int(x/2)+1):
        if (x%j == 0):
            break

        if (j == int(x/2)):
            print(x)
            sys.exit()

    x += 1



Failing test case input:
892

Expected output:
907


Actual output:

Fixed submission (verdict: Accepted):
import sys
x = int(input())

if x == 2 or x == 3:
    print(x)
    sys.exit()

for i in range(10000):

    for j in range(2, int(x/2)+1):
        if (x%j == 0):
            break

        if (j == int(x/2)):
            print(x)
            sys.exit()

    x += 1

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=int(input())

for i in range(a+1,10**6):
  isprime=True
  for j in range(2,i):
    if i%j==0:
      isprime=False
      break
  if isprime==True:
    print(i)
    exit()

Failing test case input:
431

Expected output:
431


Actual output:
433


Fixed submission (verdict: Accepted):
a=int(input())

for i in range(a,10**6):
  isprime=True
  for j in range(2,i):
    if i%j==0:
      isprime=False
      break
  if isprime==True:
    print(i)
    exit()

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import sys
INF = float("inf")

import math
import collections


def factorial(n):
    
    prime_count = collections.Counter()

    for i in range(2, int(math.sqrt(n)) + 2):
        while n % i == 0:
            n /= i
            prime_count[i] += 1
    if n > 1:
        prime_count[int(n)] += 1

    return prime_count


def solve(X: int):

    for i in range(X, 2*X+100):
        c = factorial(i)
        if len(c) == 1:
            break
    print(i)

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  
    solve(X)


if __name__ == '__main__':
    main()


Failing test case input:
341

Expected output:
347


Actual output:
343


Fixed submission (verdict: Accepted):

import sys
INF = float("inf")

import math
import collections


def factorial(n):
    
    prime_count = collections.Counter()

    for i in range(2, int(math.sqrt(n)) + 2):
        while n % i == 0:
            n /= i
            prime_count[i] += 1
    if n > 1:
        prime_count[int(n)] += 1

    return prime_count


def solve(X: int):

    for i in range(X, 2*(10**5)):
        c = factorial(i)
        if len(c) == 1 and list(c.values())[0] == 1:
            print(i)
            break
    else:
        raise Error

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  
    solve(X)


if __name__ == '__main__':
    main()
Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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, 10**5):
    if is_prime(i):
        print(i)
        break

Failing test case input:
99992

Expected output:
100003

Actual output:

Fixed submission (verdict: Accepted):
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

Problem: p02819
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import bisect
sieve=[1]*1000001
i=2
while i*i<=1000001:
    if sieve[i]==1:
        for j in range(i*i,1000001,i):
            sieve[j]=0
    i+=1
lol=[]
for i in range(2,1000001):
    if sieve[i]:
        lol.append(i)
        
x=int(input())
print(lol[bisect.bisect(lol,x)])

Failing test case input:
433

Expected output:
433


Actual output:
439


Fixed submission (verdict: Accepted):
import bisect
sieve=[1]*1000001
i=2
while i*i<=1000001:
    if sieve[i]==1:
        for j in range(i*i,1000001,i):
            sieve[j]=0
    i+=1
lol=[]
for i in range(2,1000001):
    if sieve[i]:
        lol.append(i)
        
x=int(input())
y=bisect.bisect(lol,x)
if lol[y-1]==x:
    print(x)
else:    
    print(lol[y])

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input());

for i in range(x + 1, 10**6):
  for k in range(2, i):
    if i % k != 0: 
      continue;
    else: 
      break;
  else:
    break;
  
print(i)

Failing test case input:
433

Expected output:
433


Actual output:
439


Fixed submission (verdict: Accepted):
x = int(input());

for i in range(x, 10**6):
  for k in range(2, i):
    if i % k != 0: 
      continue;
    else: 
      break;
  else:
    break;
  
print(i)

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def isPrime(n):
    for i in range(2,N):
        if N%i == 0:
            return False
    
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

N = int(input())
if(isPrime(N)):
    print(str(N))
else:
    print(str(find_next_prime(N+1)))


Failing test case input:
997

Expected output:
997


Actual output:
1009


Fixed submission (verdict: Accepted):
def isPrime(n):
    for i in range(2,N):
        if N%i == 0:
            return False
    return True
    
    
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

N = int(input())
if(isPrime(N)):
    print(str(N))
else:
    print(str(find_next_prime(N+1)))
Problem: p02819
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

import math
x = int(input())


n = [i for i in range(2,int(math.sqrt(x))+1)]

for i in n:
    for j in n:
        if j % i == 0 and j/i !=1:
            n.remove(j)
            
while x > 0:
    x +=1
    for i in n:
        if x % i == 0:
            break
    else:
        print(x)
        break


Failing test case input:
331

Expected output:
331


Actual output:
337


Fixed submission (verdict: Accepted):

import math
x = int(input())


n = [i for i in range(2,int(math.sqrt(x))+1)]

for i in n:
    for j in n:
        if j % i == 0 and j/i !=1:
            n.remove(j)
            
while x > 0:
    for i in n:
        if x % i == 0:
            break
    else:
        print(x)
        break
    x+=1

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

x = int(input())


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


for n in range(100001):
    if n >= x and is_prime(n):
        print(n)
        break


Failing test case input:
99992

Expected output:
100003

Actual output:

Fixed submission (verdict: Accepted):
import math

x = int(input())


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


for n in range(100005):
    if n >= x and is_prime(n):
        print(n)
        break

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X = int(input())


def prime(n):
    if n == 2:
        return True
    if n < 1:
        return False
    return pow(2, n - 1, n) == 1


ans = X+1
while True:
    if prime(ans) == True:
        print(ans)
        break
    else:
        ans += 1


Failing test case input:
331

Expected output:
331


Actual output:
337


Fixed submission (verdict: Accepted):
X = int(input())


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

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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


def main():
    x = int(input())

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


if __name__ == '__main__':
    main()


Failing test case input:
99992

Expected output:
100003

Actual output:

Fixed submission (verdict: Accepted):
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


def main():
    x = int(input())

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


if __name__ == '__main__':
    main()
Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x =  int(input())

def primes(z, n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(z, 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]]

Prime = primes(x, 10**5)
ans = Prime[0]
print(ans)

Failing test case input:
275

Expected output:
277


Actual output:
2


Fixed submission (verdict: Accepted):
x =  int(input())
 
def primes(z, 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]) and (i>=z) ]

Prime = primes(x, (10**5)+4)
ans = Prime[0]
print(ans)

Problem: p02819
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
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())

if is_prime(x):
    print(x)
    sys.exit()

for i in range(x,int(1e5)):
    for j in range(2,x):
        if i % j == 0:
            break
        elif j == x-1:
            print(i)
            sys.exit()

print(None)

Failing test case input:
99992

Expected output:
100003

Actual output:
None


Fixed submission (verdict: Accepted):
import sys
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())

if is_prime(x):
    print(x)
    sys.exit()

for i in range(x,int(1e5)+100):
    for j in range(2,x):
        if i % j == 0:
            break
        elif j == x-1:
            print(i)
            sys.exit()
Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
x = int(input())
i = 2
INF = 100001-x
while (i <= x):
    if (x%i == 0 and x != i):
        break
    if (x % i == 0 and x == i):
        print(i)
        sys.exit()

    if (i % 2 == 1):
        i += 2
    else:
        i += 1

while (x <= INF):
    i = max(2,x - 100)
    while(i <= x):
        if (x%2 == 0 ):
            x += 1
            continue
        if (x%i == 0 and x != i):
            x += 2
            break
        if (x % i == 0 and x == i):
            print(i)
            sys.exit()
        else:
            i += 1
    x += 2

Failing test case input:
5496

Expected output:
5501


Actual output:
5497


Fixed submission (verdict: Accepted):
import sys
x = int(input())
i = 2
INF = 100000000
while (i <= x):
    if (x%i == 0 and x != i):
        break
    if (x % i == 0 and x == i):
        print(x)
        sys.exit()
    i += 1

while (x < INF):
    i = 2
    while(i <= x):
        if (i % 2 == 0):
            i += 1
            continue

        if (x % 2 == 0):
            x += 1
            continue

        if (x % i == 0 and x != i):
            x += 1
            break

        if (x % i == 0 and x == i):
            print(x)
            sys.exit()

        else:
            i += 2

    x += 1

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())
count = 0

from math import sqrt

while count == 0:
  k = 0
  if x % 2 == 0:
    x += 1
  else:
    x += 2
  for i in range(1, x):
    if x % i == 0:
      k += 1
  if k == 1:
    print(x)
    count = 1

Failing test case input:
577

Expected output:
577


Actual output:
587


Fixed submission (verdict: Accepted):
x = int(input())
count = 0

from math import sqrt

while count == 0:
  k = 0
  for i in range(1, x):
    if x % i == 0:
      k += 1
  if k == 1:
    print(x)
    count = 1
  else:
    if x % 2 == 0:
      x += 1
    else:
      x += 2

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math


def isPrime(k):
    if k % 2 == 0 and k != 2:
        return False

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

    return k


x = int(input())
limitX = 2 * x - 1

for i in range(x + 1, limitX):
    if isPrime(i):
        print(i)
        exit()


Failing test case input:
331

Expected output:
331


Actual output:
337


Fixed submission (verdict: Accepted):
import math


def isPrime(k):
    if k % 2 == 0 and k != 2:
        return False

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

    return k


x = int(input())
limitX = 2 * x - 1

for i in range(x, limitX):
    if isPrime(i):
        print(i)
        exit()
Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
import sys
input = sys.stdin.readline

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

def main():
    X = int(input())
    for i in range(X, 100003):
        if is_prime(i):
            print(i)
            break

if __name__ == '__main__': main()

Failing test case input:
99992

Expected output:
100003

Actual output:

Fixed submission (verdict: Accepted):
import math
import sys
input = sys.stdin.readline

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

def main():
    X = int(input())
    for i in range(X, 100004):
        if is_prime(i):
            print(i)
            break

if __name__ == '__main__': main()

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X = int(input())

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

Failing test case input:
577

Expected output:
577


Actual output:
587


Fixed submission (verdict: Accepted):
X = int(input())

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

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x=int(input())
import math
def is_prime(n):
    for divisor in range(2,math.floor(math.sqrt(n))+1):
        if n%divisor == 0:
            return False
    return True


for k in range(x,100002):
    if is_prime(k) == True:
        print(k)
        exit()
        
    

Failing test case input:
99992

Expected output:
100003

Actual output:

Fixed submission (verdict: Accepted):
x=int(input())
import math
def is_prime(n):
    if n==1:
        return False
    for divisor in range(2,int(math.sqrt(n))+1):
        if n%divisor == 0:
            return False
    return True

k=0
while True:
    if is_prime(x+k):
        print(x+k)
        break
    else:
        k += 1

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X = int(input())
while X != 'prime':
    for i in range(2,X):
        if X%i == 0:
            X+=1
            continue
    break
print(X)  


Failing test case input:
384

Expected output:
389


Actual output:
387


Fixed submission (verdict: Accepted):
X = int(input())
while X != 'prime':
    for i in range(2,X):
        if X%i == 0:
            break
    else:
        break
    X+=1

            
print(X)
Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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())

min_prime = 2

for i in range(x, 100000):
    if is_prime(i) is True:
        min_prime = i
        break

print(min_prime)


Failing test case input:
99992

Expected output:
100003

Actual output:
2


Fixed submission (verdict: Accepted):
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())

min_prime = 2

for i in range(x, 10 ** 6):
    if is_prime(i) is True:
        min_prime = i
        break

print(min_prime)

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X = int(input())

r = X

while(True):
	for i in range(2, r):
		if r%i == 0:
			r += 1
			continue      
	else:
		break
print(r)

Failing test case input:
777

Expected output:
787


Actual output:
779


Fixed submission (verdict: Accepted):
X = int(input())

r = X

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

Problem: p02819
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
X=int(input())
import sys
for i in range(X,10**5+1):
  T=True
  for j in range(2,i):
    if i%j==0:
      T=False
  if T==True:
    print(i)
    break
  else:
    continue

Failing test case input:
99992

Expected output:
100003

Actual output:

Fixed submission (verdict: Accepted):
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

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = 10**5
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)

m = int(input())
for i in range(len(primes)-1):
  if primes[i] <= m and m <= primes[i+1]:
    print(primes[i+1])
    


Failing test case input:
331

Expected output:
331


Actual output:
331
337


Fixed submission (verdict: Accepted):
m = int(input())
if m <= 2 :
  print('2')
else:
  n = 10**6
  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)

  for i in range(len(primes)-1):
    if primes[i] < m and m <= primes[i+1]:
      print(primes[i+1])
Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

X = int(input())

flg = 1
ans = 0
print(10**5)
for i in range(X, 10**100):
    flg = 1
    for j in range(2, i):
        if i % j == 0:
            flg = 0
            break
    if flg == 1:
        ans = i
        break

print(ans)

Failing test case input:
927

Expected output:
929


Actual output:
100000
929


Fixed submission (verdict: Accepted):

X = int(input())

flg = 1
ans = 0
for i in range(X, 10**100):
    flg = 1
    for j in range(2, i):
        if i % j == 0:
            flg = 0
            break
    if flg == 1:
        ans = i
        break

print(ans)

Problem: p02819
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
x=int(input())
def is_prime(n):
    if n <= 1:
        return False
    for i in range(2, int(math.sqrt(n)) +1):
        if n % i == 0:
            return False
    return True
for i in range(x, 100003):
    if is_prime(i):
        print(i)
        exit()

Failing test case input:
99992

Expected output:
100003

Actual output:

Fixed submission (verdict: Accepted):
import math
x=int(input())
def is_prime(n):
    if n <= 1:
        return False
    for i in range(2, int(math.sqrt(n)) +1):
        if n % i == 0:
            return False
    return True
for i in range(x, 100003+1):
    if is_prime(i):
        print(i)
        exit()

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
primes = [2]

x = int(input())
for i in range(3, x * 2):
    is_p = True
    for p in primes:
        if i < p * p:
            break
        if i % p == 0:
            is_p = False
            break
    if is_p:
        primes.append(i)

print([i for i in primes if i > x][0])


Failing test case input:
431

Expected output:
431


Actual output:
433


Fixed submission (verdict: Accepted):
primes = [2]

x = int(input())
for i in range(3, x * 2):
    is_p = True
    for p in primes:
        if i < p * p:
            break
        if i % p == 0:
            is_p = False
            break
    if is_p:
        primes.append(i)

print([i for i in primes if i >= x][0])

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())

for i in range(10^5):
  n = 2
  while x % n != 0 and n <= x**0.5 + 2:
    n += 1
  if n < x**0.5 + 2:
    x += 1
    
  else:
    print(x)
    break
      

Failing test case input:
892

Expected output:
907


Actual output:

Fixed submission (verdict: Accepted):
x = int(input())

while True:
  n = 2
  while x % n != 0 and n <= x/2:
    n += 1
  if n < x/2:
    x += 1
    
  else:
    print(x)
    break
Problem: p02819
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
X = int(input())

prime = []
for n in range(3, X+1, 2):
    lim = int(n ** 0.5)
    f = True
    for p in prime:
        if p > lim:
            break
        if n % p == 0:
            f = False
            break
    if f:
        prime.append(n)
if X >= 2:
    prime = [2] + prime

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

Failing test case input:
431

Expected output:
431


Actual output:
433


Fixed submission (verdict: Accepted):
X = int(input())

prime = []
for n in range(3, X, 2):
    lim = int(n ** 0.5)
    f = True
    for p in prime:
        if p > lim:
            break
        if n % p == 0:
            f = False
            break
    if f:
        prime.append(n)
if X >= 3:
    prime = [2] + prime

for n in range(X, X+10**5):
    for p in prime:
        if n % p == 0:
            break
    else:
        print(n)
        break

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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

X = int(input())
while is_prime(X) is False:
    X += 1
print(X)


Failing test case input:
341

Expected output:
347


Actual output:
341


Fixed submission (verdict: Accepted):
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 is_prime(X) is False:
    X += 1
print(X)

Problem: p02819
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
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())

if is_prime(x):
    print(x)
    sys.exit()

for i in range(x,int(1e5)):
    for j in range(2,x):
        if i % j == 0:
            break
        elif j == x-1:
            print(i)
            sys.exit()

Failing test case input:
99992

Expected output:
100003

Actual output:

Fixed submission (verdict: Accepted):
import sys
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())

if is_prime(x):
    print(x)
    sys.exit()

for i in range(x,int(1e5)+100):
    for j in range(2,x):
        if i % j == 0:
            break
        elif j == x-1:
            print(i)
            sys.exit()
Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())

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

i = x
while not is_prime(i):
    i += 1

print(i)


Failing test case input:
341

Expected output:
347


Actual output:
341


Fixed submission (verdict: Accepted):
import math

x = int(input())

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

i = x
while not is_prime(i):
    i += 1

print(i)

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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 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

Failing test case input:
4751

Expected output:
4751


Actual output:
4759


Fixed submission (verdict: Accepted):
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

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def P(n):
    if type(n)!=int:raise TypeError
    if n<1:raise ValueError
    if n==1:return -1
    if n&1==0:return 2
    a=1
    while a*a<n:
        a+=2
        if n%a==0:return a
    return 0
import math
a=int(input())
while P(a)==0:a+=1
print(a)

Failing test case input:
2425

Expected output:
2437


Actual output:
2425


Fixed submission (verdict: Accepted):
def P(n):
    if type(n)!=int:raise TypeError
    if n<1:raise ValueError
    if n==1:return -1
    if n%2==0and n!=2:return 2
    a=3
    while a*a<n:
        if n%a==0:return a
        a+=2
    return 0
import math
a=int(input())
while P(a):a+=1
print(a)

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x=int(input())
while(x%i<1 for i in range(2,x)):
  x+=1
  break
print(x)

Failing test case input:
1955

Expected output:
1973


Actual output:
1956


Fixed submission (verdict: Accepted):
x = int(input())
while any(x % i < 1 for i in range(2, x)): 
    x += 1
print(x)

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)


Failing test case input:
5560

Expected output:
5563


Actual output:
5561


Fixed submission (verdict: Accepted):
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)
Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def isPrime(x):
    if x <= 1: return False
    i = 2
    while i ** 2 <= x:
        if x % i == 0: return False
        i += 1
    return True

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

Failing test case input:
577

Expected output:
577


Actual output:
587


Fixed submission (verdict: Accepted):
def isPrime(x):
    if x <= 1: return False
    i = 2
    while i ** 2 <= x:
        if x % i == 0: return False
        i += 1
    return True

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

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

x = int(input())

for j in range(x,10**5):
    flag = True
    for i in range(2,int(math.sqrt(x))+1):
        if j%i == 0:
            flag = False
    if flag:
        print(j)
        break



Failing test case input:
99992

Expected output:
100003

Actual output:

Fixed submission (verdict: Accepted):
import math

x = int(input())

for j in range(x,10**6):
    flag = True
    for i in range(2,int(math.sqrt(x))+1):
        if j%i == 0:
            flag = False
    if flag:
        print(j)
        break

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
import math
input = sys.stdin.readline

def multiples(n, x):
    for i in range(3,x):
        yield i*n
        if i*n > x:
            break

def sosuu(x):
    if x == 2 : return 2
    d = set()
    end = math.ceil(math.sqrt(x))
    d = d.union(multiples(2, x))
    for i in range(3,end,2):
        if i not in d:
            d = d.union(set(multiples(i, x)))
    
    i = x if x % 2 != 0 else x+1
    while True:
        if i not in d:
            return i
        i += 2

def main():
    x = int(input())
    print(sosuu(x))

if __name__ == "__main__":
    main()

Failing test case input:
298

Expected output:
307


Actual output:
303


Fixed submission (verdict: Accepted):
import sys
import math
input = sys.stdin.readline

def multiples(n):
    for i in range(3,100003):
        yield i*n
        if i*n > 100003:
            break

def sosuu(x):
    if x == 2 : return 2
    d = set()
    end = math.ceil(math.sqrt(x))
    d = d.union(multiples(2))
    for i in range(3,end,2):
        if i not in d:
            d = d.union(set(multiples(i)))
    
    i = x if x % 2 != 0 else x+1
    while True:
        if i not in d:
            return i
        i += 2

def main():
    x = int(input())
    print(sosuu(x))

if __name__ == "__main__":
    main()
Problem: p02819
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import math

def is_prime(x):
    if x < 2: return False 
    if x == 2 or x == 3 or x == 5: return True 
    if x % 2 == 0 or x % 3 == 0 or x % 5 == 0: return False 

    
    prime = 7
    step = 4
    while prime <= math.sqrt(x):
        if x % prime == 0: return False

        prime += step
        step = 6 - step

    return True

n = int(input())

for i in range(0,10**5):
  if is_prime(n+i)==True:
    print(n)
    exit()


Failing test case input:
357

Expected output:
359


Actual output:
357


Fixed submission (verdict: Accepted):
import math

def is_prime(x):
    if x < 2: return False 
    if x == 2 or x == 3 or x == 5: return True 
    if x % 2 == 0 or x % 3 == 0 or x % 5 == 0: return False 

    
    prime = 7
    step = 4
    while prime <= math.sqrt(x):
        if x % prime == 0: return False

        prime += step
        step = 6 - step

    return True

n = int(input())

for i in range(0,10**5):
  if is_prime(n+i)==True:
    print(n+i)
    exit()

Problem: p02819
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

X = int(input())
double = X*2+1
s = set()
for i in range(2, double):
    if i in s:
        continue
    if i>X:
        print(i)
        break
    cnt = 1
    while cnt*i<=double:
        s.add(i*cnt)
        cnt += 1

Failing test case input:
997

Expected output:
997


Actual output:
1009


Fixed submission (verdict: Accepted):
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

X = int(input())
double = X*10+1
s = set()
for i in range(2, double):
    if i in s:
        continue
    if i>=X:
        print(i)
        break
    cnt = 1
    while cnt*i<=double:
        s.add(i*cnt)
        cnt += 1

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X = int(input())
ans = X
flag = True
while flag == True:
    flag = False
    ans += 1
    for i in range(2, ans):
        if ans % i == 0:
            flag = True
            break
print(ans)

Failing test case input:
997

Expected output:
997


Actual output:
1009


Fixed submission (verdict: Accepted):
X = int(input())
ans = X - 1
flag = True
while flag == True:
    flag = False
    ans += 1
    for i in range(2, ans):
        if ans % i == 0:
            flag = True
            break
print(ans)

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

X=int(input())

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

q=X
while is_prime(q)==False:
    q=q+1

print(q)

Failing test case input:
341

Expected output:
347


Actual output:
341


Fixed submission (verdict: Accepted):

X=int(input())

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

q=X
while is_prime(q)==False:
    q=q+1

print(q)
Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

X=int(input())

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

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


Failing test case input:
341

Expected output:
347


Actual output:
341


Fixed submission (verdict: Accepted):
X=int(input())

def isPrime(n):
  if n < 2:
    
    return False
  if n == 2:
    
    return True
  for p in range(2, n):
      if n % p == 0:
        
        return False
  
  return True
  
while 1==1:
    if isPrime(X)==True:
        print(X)
        quit()
    X+=1

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x=int(input())
for i in range(x,10**5+1):
    for j in range(2,i):
        if i%j==0:
            break 
    else:
         print(i)
         break
 

Failing test case input:
99992

Expected output:
100003

Actual output:

Fixed submission (verdict: Accepted):
x=int(input())
for i in range(x,10**6):
    for j in range(2,i):
        if i%j==0:
            break 
    else:
         print(i)
         break

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x=int(input())

def pr(n):
    for p in range(2,n):
        if n%p==0:
            return pr(n+1)
    return n

print(pr(x+1))

Failing test case input:
577

Expected output:
577


Actual output:
587


Fixed submission (verdict: Accepted):
x=int(input())

def pr(n):
    for p in range(2,n):
        if n%p==0:
            return pr(n+1)
    return n
print(pr(x))

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X = int(input())

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

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

Failing test case input:
341

Expected output:
347


Actual output:
341


Fixed submission (verdict: Accepted):
X = int(input())

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

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

    return True

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

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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


def main():
    x = int(input())

    for i in range(x, 10**5):
        if is_prime(i):
            print(i)
            exit()


if __name__ == '__main__':
    main()


Failing test case input:
99992

Expected output:
100003

Actual output:

Fixed submission (verdict: Accepted):
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


def main():
    x = int(input())

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


if __name__ == '__main__':
    main()
Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = int(input())

def mark(s, x):
    for i in range(x + x, len(s), x):
        s[i] = False

def sieve(n):
    s = [True] * n
    for x in range(2, int(n**0.5) + 1):
        if s[x]: mark(s, x)
    return [i for i in range(0,n) if s[i] and i > a]

s = (sieve(a * 2))
print(s[0])

Failing test case input:
577

Expected output:
577


Actual output:
587


Fixed submission (verdict: Accepted):
a = int(input())

def mark(s, x):
    for i in range(x + x, len(s), x):
        s[i] = False

def sieve(n):
    s = [True] * n
    for x in range(2, int(n**0.5) + 1):
        if s[x]: mark(s, x)
    return [i for i in range(0,n) if s[i] and i >= a]

s = sieve(a * 2)
print(s[0])

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def primes(n):
    i = 1
    p = [2]
    while i+2 <= n:
        flag = True
        i += 2
        for j in range(3, int(i**(1/2))+1, 2):
            if i % j == 0:
                flag = False
                break
        if flag:
            p.append(i)
    return p
            
n = int(input())
p = primes(10**5+1000)
print([i for i in p if i > n][0])
        

Failing test case input:
997

Expected output:
997


Actual output:
1009


Fixed submission (verdict: Accepted):
def primes(n):
    i = 1
    p = [2]
    while i+2 <= n:
        flag = True
        i += 2
        for j in range(3, int(i**(1/2))+1, 2):
            if i % j == 0:
                flag = False
                break
        if flag:
            p.append(i)
    return p
            
n = int(input())
p = primes(10**5+10)
print([i for i in p if i >= n][0])

Problem: p02819
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
for i in range(n, 10**5) :
    for j in range(2, i) :
        if i % j == 0 :
            break
    else :
        print(i)
        break

Failing test case input:
99992

Expected output:
100003

Actual output:

Fixed submission (verdict: Accepted):
n = int(input())
for i in range(n, 10**6) :
    for j in range(2, i) :
        if i % j == 0 :
            break
    else :
        print(i)
        break

Problem: p02819
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
x = int(input().split()[0])
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]

data = get_sieve_of_eratosthenes(2*x)
for i in data:
  if i > x:
    print(i)
    break

Failing test case input:
331

Expected output:
331


Actual output:
337


Fixed submission (verdict: Accepted):
import math
x = int(input().split()[0])
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]

data = get_sieve_of_eratosthenes(2*x+10)
for i in data:
  if i >= x:
    print(i)
    break