stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main ()

{

    int n,i,j;

    bool flag=true;

     cin>>n;

   for(i=n;i>0;i++)

   {

       flag=true;

    for(j=2;j<=(i/2);j++)

    {

        if(i%j==0)

        {

          flag=false;

          break;

        }

    }

    if(flag==true)

    {

        cout<<i<<endl;

        i=-1;

    }

   }





}






// Faster C++ solution for the same problem (measured speedup: 5.036276138263123x):
#include<stdio.h>



int isPrime(int n)

{

    int i,count=0;



    if(n>1)



    {

        for(i=2; i<n; i++)

        {

            if(n % i == 0)

            {

                count++;

                break;

            }

        }

    }

    if(n==1)

        return 0;

    else

    {



        if(count==0)

        {

            return 1;

        }



        else

        {

            return 0;

        }

    }

}



int main()



{

    int number,ans;



    scanf("%d",&number);

    while(1)

    {

        ans = isPrime(number);

        if(ans == 1)

        {

            printf("%d",number );

            break ;

        }

        else

            number ++ ;







    }

    return 0;











}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

 

int main(){

	   

	ios_base::sync_with_stdio(false);

	cin.tie(NULL);

	int n;

	cin>>n;

	while(1){

	   bool flag = true;

	    for(int i=2; i<n; i++){

	        if(n%i==0){

	            flag = false;

	            break;

	        }

	    }

	    if(flag) break;

	    n++;

	}

	cout<< n <<endl;

	 

return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.129501632343916x):
#include<stdio.h>



int isPrime(int n)

{

    int i,count=0;



    if(n>1)



    {

        for(i=2; i<n; i++)

        {

            if(n % i == 0)

            {

                count++;

                break;

            }

        }

    }

    if(n==1)

        return 0;

    else

    {



        if(count==0)

        {

            return 1;

        }



        else

        {

            return 0;

        }

    }

}



int main()



{

    int number,ans;



    scanf("%d",&number);

    while(1)

    {

        ans = isPrime(number);

        if(ans == 1)

        {

            printf("%d",number );

            break ;

        }

        else

            number ++ ;







    }

    return 0;











}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

vector <bool> isprime (100005,true);

vector<int> prime;

vector<int> spf(100005);

void s(int n){

    isprime[0]=false;

    isprime[1]=false;

    for(int i=0;i<=n+1;i++){

        if(isprime[i]){

            prime.push_back(i);

            spf[i]=i;

        }

        for(int j=0;j<(int)prime.size() && i*prime[j]<=n+1 && prime[j]<=spf[i];j++){

            isprime[i*prime[j]]=false;

            spf[i*prime[j]]=prime[j];

        }

    }

}

int main(){

    int n;

    cin>>n;

    s(100004);

    if(isprime[n]==1){

        cout<<n;

    }

    else{

        int i=n+1;

        while(!isprime[i]){

            i++;

        }

        cout<<i;

    }

}

// Faster C++ solution for the same problem (measured speedup: 2.2858728090612654x):


#include <bits/stdc++.h>

#include<algorithm>

#include<cstring>

#include<cmath>

#include<cstdlib>

#include<string.h>

using namespace std;

#define pb push_back

#define all(v) v. begin(),v. end()

#define  rep(i,n,v) for(i=n;i<v;i++)

#define per(i,n,v) for(i=n;i>v;i--)

#define ff first 

#define ss second 

#define pp pair<ll,ll>

#define eps 1e-6

#define ll  long long

#define endl '\n'

bool isPrime(ll a)

{

  ll count=0,i;

  rep(i,2,a/2+1)

    if(a%i==0) count++;

    if(count) return false;

    else return true;

}

void solve()

{

  ll n, a,m=0,b=1, k=0, i, j,l=2e9+7;

  string s, r, y;

  cin>>n;

 while(n)

 {

   if(isPrime(n)) {cout<<n;break;}

   n++;}

}

int main()

{

 ios_base::sync_with_stdio(false);

  cin. tie(0);cout. tie(0);

    ll t=1;

  // cin>>t;

    while(t--)

    {

      solve();

    }

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;

typedef long long ll ;

const int N =  1e5 ;

int main()

{

    vector<int>primes;

    int vis[100001];

    memset(vis , 0 , sizeof vis);

    for(int i =2 ; i <= N ; i++)

    {

        if(!vis[i])

        {

            primes.push_back(i);

            for(int j = i+i ; j <= N ;j+=i)

            {

                vis[j]=1;

            }

        }

    }

    primes.push_back(100003);

    ll n;

    cin >> n;

    cout << *lower_bound(primes.begin(),primes.end(),n) ;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 2.461099481064094x):


#include <bits/stdc++.h>

#include<algorithm>

#include<cstring>

#include<cmath>

#include<cstdlib>

#include<string.h>

using namespace std;

#define pb push_back

#define all(v) v. begin(),v. end()

#define  rep(i,n,v) for(i=n;i<v;i++)

#define per(i,n,v) for(i=n;i>v;i--)

#define ff first 

#define ss second 

#define pp pair<ll,ll>

#define eps 1e-6

#define ll  long long

#define endl '\n'

bool isPrime(ll a)

{

  ll count=0,i;

  rep(i,2,a/2+1)

    if(a%i==0) count++;

    if(count) return false;

    else return true;

}

void solve()

{

  ll n, a,m=0,b=1, k=0, i, j,l=2e9+7;

  string s, r, y;

  cin>>n;

 while(n)

 {

   if(isPrime(n)) {cout<<n;break;}

   n++;}

}

int main()

{

 ios_base::sync_with_stdio(false);

  cin. tie(0);cout. tie(0);

    ll t=1;

  // cin>>t;

    while(t--)

    {

      solve();

    }

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

vector <bool> isprime (100005,true);

vector<int> prime;

vector<int> spf(100005);

void s(int n){

    isprime[0]=false;

    isprime[1]=false;

    for(int i=0;i<=n+1;i++){

        if(isprime[i]){

            prime.push_back(i);

            spf[i]=i;

        }

        for(int j=0;j<(int)prime.size() && i*prime[j]<=n+1 && prime[j]<=spf[i];j++){

            isprime[i*prime[j]]=false;

            spf[i*prime[j]]=prime[j];

        }

    }

}

int main(){

    int n;

    cin>>n;

    s(100004);

    if(isprime[n]==1){

        cout<<n;

    }

    else{

        int i=n+1;

        while(!isprime[i]){

            i++;

        }

        cout<<i;

    }

}

// Faster C++ solution for the same problem (measured speedup: 2.412109600931667x):
#include<iostream>

using namespace std;



const int N = 1e5+2;

bool check(int z)

{ int i;

   for(i=2;i*i<=z;i++)

    { if(z%i==0)

       return false;

    }

    return true;

}

int main()

{

 int x;

    cin>>x;

    while(!check(x))x++;

    cout<<x;

 }
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;

typedef long long ll ;

const int N =  1e5 ;

int main()

{

    vector<int>primes;

    int vis[100001];

    memset(vis , 0 , sizeof vis);

    for(int i =2 ; i <= N ; i++)

    {

        if(!vis[i])

        {

            primes.push_back(i);

            for(int j = i+i ; j <= N ;j+=i)

            {

                vis[j]=1;

            }

        }

    }

    primes.push_back(100003);

    ll n;

    cin >> n;

    cout << *lower_bound(primes.begin(),primes.end(),n) ;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 2.5970131249605926x):
#include<iostream>

using namespace std;



const int N = 1e5+2;

bool check(int z)

{ int i;

   for(i=2;i*i<=z;i++)

    { if(z%i==0)

       return false;

    }

    return true;

}

int main()

{

 int x;

    cin>>x;

    while(!check(x))x++;

    cout<<x;

 }
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

vector <bool> isprime (100005,true);

vector<int> prime;

vector<int> spf(100005);

void s(int n){

    isprime[0]=false;

    isprime[1]=false;

    for(int i=0;i<=n+1;i++){

        if(isprime[i]){

            prime.push_back(i);

            spf[i]=i;

        }

        for(int j=0;j<(int)prime.size() && i*prime[j]<=n+1 && prime[j]<=spf[i];j++){

            isprime[i*prime[j]]=false;

            spf[i*prime[j]]=prime[j];

        }

    }

}

int main(){

    int n;

    cin>>n;

    s(100004);

    if(isprime[n]==1){

        cout<<n;

    }

    else{

        int i=n+1;

        while(!isprime[i]){

            i++;

        }

        cout<<i;

    }

}

// Faster C++ solution for the same problem (measured speedup: 2.411868242274701x):
#include <bits/stdc++.h>

#include<cmath>

#include<iomanip>

#include <algorithm>

#include<string.h>

#include<queue>

#include<deque>

#include<set>



using namespace std;

//cout<<setprecision(9)<<fixed<<a;

typedef long long ll;





int main()



{



     int n;

     cin>>n;

     while(1)

     {

          bool p=true;

         for(int i=2; i*i<=n; i++)

         {

             if(n%i==0)

             {

                   p=false;

                   n++;

                  break;

             }



         }

         if(p)

         {

             return cout<<n,0;

         }



     }



}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;

typedef long long ll ;

const int N =  1e5 ;

int main()

{

    vector<int>primes;

    int vis[100001];

    memset(vis , 0 , sizeof vis);

    for(int i =2 ; i <= N ; i++)

    {

        if(!vis[i])

        {

            primes.push_back(i);

            for(int j = i+i ; j <= N ;j+=i)

            {

                vis[j]=1;

            }

        }

    }

    primes.push_back(100003);

    ll n;

    cin >> n;

    cout << *lower_bound(primes.begin(),primes.end(),n) ;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 2.59675326462932x):
#include <bits/stdc++.h>

#include<cmath>

#include<iomanip>

#include <algorithm>

#include<string.h>

#include<queue>

#include<deque>

#include<set>



using namespace std;

//cout<<setprecision(9)<<fixed<<a;

typedef long long ll;





int main()



{



     int n;

     cin>>n;

     while(1)

     {

          bool p=true;

         for(int i=2; i*i<=n; i++)

         {

             if(n%i==0)

             {

                   p=false;

                   n++;

                  break;

             }



         }

         if(p)

         {

             return cout<<n,0;

         }



     }



}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

vector <bool> isprime (100005,true);

vector<int> prime;

vector<int> spf(100005);

void s(int n){

    isprime[0]=false;

    isprime[1]=false;

    for(int i=0;i<=n+1;i++){

        if(isprime[i]){

            prime.push_back(i);

            spf[i]=i;

        }

        for(int j=0;j<(int)prime.size() && i*prime[j]<=n+1 && prime[j]<=spf[i];j++){

            isprime[i*prime[j]]=false;

            spf[i*prime[j]]=prime[j];

        }

    }

}

int main(){

    int n;

    cin>>n;

    s(100004);

    if(isprime[n]==1){

        cout<<n;

    }

    else{

        int i=n+1;

        while(!isprime[i]){

            i++;

        }

        cout<<i;

    }

}

// Faster C++ solution for the same problem (measured speedup: 2.4151971413313493x):
#include <iostream>

#include<bits/stdc++.h>



using namespace std;

bool isPrime (int x ) ;



int main()

{

    int x ;

    scanf ("%d",&x);

    while (1)

    {

                 if (isPrime(x))

                 {

                            printf ("%d",x);  break ;

                 }

                 x++;

    }

    return 0;

}

bool isPrime (int x )

{

             if (x==1) return false ;

             int i ;

             for (i=2 ; i<x ; i++)

             {

                          if (x%i==0)

                                       return false ;

             }

             return true ;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;

typedef long long ll ;

const int N =  1e5 ;

int main()

{

    vector<int>primes;

    int vis[100001];

    memset(vis , 0 , sizeof vis);

    for(int i =2 ; i <= N ; i++)

    {

        if(!vis[i])

        {

            primes.push_back(i);

            for(int j = i+i ; j <= N ;j+=i)

            {

                vis[j]=1;

            }

        }

    }

    primes.push_back(100003);

    ll n;

    cin >> n;

    cout << *lower_bound(primes.begin(),primes.end(),n) ;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 2.600337344945756x):
#include <iostream>

#include<bits/stdc++.h>



using namespace std;

bool isPrime (int x ) ;



int main()

{

    int x ;

    scanf ("%d",&x);

    while (1)

    {

                 if (isPrime(x))

                 {

                            printf ("%d",x);  break ;

                 }

                 x++;

    }

    return 0;

}

bool isPrime (int x )

{

             if (x==1) return false ;

             int i ;

             for (i=2 ; i<x ; i++)

             {

                          if (x%i==0)

                                       return false ;

             }

             return true ;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

vector <bool> isprime (100005,true);

vector<int> prime;

vector<int> spf(100005);

void s(int n){

    isprime[0]=false;

    isprime[1]=false;

    for(int i=0;i<=n+1;i++){

        if(isprime[i]){

            prime.push_back(i);

            spf[i]=i;

        }

        for(int j=0;j<(int)prime.size() && i*prime[j]<=n+1 && prime[j]<=spf[i];j++){

            isprime[i*prime[j]]=false;

            spf[i*prime[j]]=prime[j];

        }

    }

}

int main(){

    int n;

    cin>>n;

    s(100004);

    if(isprime[n]==1){

        cout<<n;

    }

    else{

        int i=n+1;

        while(!isprime[i]){

            i++;

        }

        cout<<i;

    }

}

// Faster C++ solution for the same problem (measured speedup: 2.40850083081697x):
#include <iostream>

#include <math.h>

#include <algorithm>

#include <string>

using namespace std;

typedef long long ll;

 const int n = 1e6+ 5;

 bool Is_Brime(int x) {

     if (x <= 1)

         return false;

     for (int i = 2; i * i <= x; i++) {

         if (x % i == 0) {

             return false;

         }

     }

     return true;

 }

     int main(){

         int x;

         cin >> x;

         while (true) {

             if (Is_Brime(x)) {

                 cout << x << endl;

                 return 0;



             }

             x++;

         }

   

    

     }
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;

typedef long long ll ;

const int N =  1e5 ;

int main()

{

    vector<int>primes;

    int vis[100001];

    memset(vis , 0 , sizeof vis);

    for(int i =2 ; i <= N ; i++)

    {

        if(!vis[i])

        {

            primes.push_back(i);

            for(int j = i+i ; j <= N ;j+=i)

            {

                vis[j]=1;

            }

        }

    }

    primes.push_back(100003);

    ll n;

    cin >> n;

    cout << *lower_bound(primes.begin(),primes.end(),n) ;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 2.5931277196916054x):
#include <iostream>

#include <math.h>

#include <algorithm>

#include <string>

using namespace std;

typedef long long ll;

 const int n = 1e6+ 5;

 bool Is_Brime(int x) {

     if (x <= 1)

         return false;

     for (int i = 2; i * i <= x; i++) {

         if (x % i == 0) {

             return false;

         }

     }

     return true;

 }

     int main(){

         int x;

         cin >> x;

         while (true) {

             if (Is_Brime(x)) {

                 cout << x << endl;

                 return 0;



             }

             x++;

         }

   

    

     }
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

vector <bool> isprime (100005,true);

vector<int> prime;

vector<int> spf(100005);

void s(int n){

    isprime[0]=false;

    isprime[1]=false;

    for(int i=0;i<=n+1;i++){

        if(isprime[i]){

            prime.push_back(i);

            spf[i]=i;

        }

        for(int j=0;j<(int)prime.size() && i*prime[j]<=n+1 && prime[j]<=spf[i];j++){

            isprime[i*prime[j]]=false;

            spf[i*prime[j]]=prime[j];

        }

    }

}

int main(){

    int n;

    cin>>n;

    s(100004);

    if(isprime[n]==1){

        cout<<n;

    }

    else{

        int i=n+1;

        while(!isprime[i]){

            i++;

        }

        cout<<i;

    }

}

// Faster C++ solution for the same problem (measured speedup: 2.4093397026321886x):
#include <bits/stdc++.h>

using namespace std;



bool prime (long long x){

    if(x <= 1)

       {return false;}

    for(long long i = 2; i*i <= x; i++){

        if(x % i == 0)

           {return false;}

    }

    return true;

}

int main(){

    long long x;

    cin >> x;

    while(true){

        if(prime (x)){

            cout << x <<endl;

            return 0;}

        x++;}}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;

typedef long long ll ;

const int N =  1e5 ;

int main()

{

    vector<int>primes;

    int vis[100001];

    memset(vis , 0 , sizeof vis);

    for(int i =2 ; i <= N ; i++)

    {

        if(!vis[i])

        {

            primes.push_back(i);

            for(int j = i+i ; j <= N ;j+=i)

            {

                vis[j]=1;

            }

        }

    }

    primes.push_back(100003);

    ll n;

    cin >> n;

    cout << *lower_bound(primes.begin(),primes.end(),n) ;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 2.5940308963604606x):
#include <bits/stdc++.h>

using namespace std;



bool prime (long long x){

    if(x <= 1)

       {return false;}

    for(long long i = 2; i*i <= x; i++){

        if(x % i == 0)

           {return false;}

    }

    return true;

}

int main(){

    long long x;

    cin >> x;

    while(true){

        if(prime (x)){

            cout << x <<endl;

            return 0;}

        x++;}}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

vector <bool> isprime (100005,true);

vector<int> prime;

vector<int> spf(100005);

void s(int n){

    isprime[0]=false;

    isprime[1]=false;

    for(int i=0;i<=n+1;i++){

        if(isprime[i]){

            prime.push_back(i);

            spf[i]=i;

        }

        for(int j=0;j<(int)prime.size() && i*prime[j]<=n+1 && prime[j]<=spf[i];j++){

            isprime[i*prime[j]]=false;

            spf[i*prime[j]]=prime[j];

        }

    }

}

int main(){

    int n;

    cin>>n;

    s(100004);

    if(isprime[n]==1){

        cout<<n;

    }

    else{

        int i=n+1;

        while(!isprime[i]){

            i++;

        }

        cout<<i;

    }

}

// Faster C++ solution for the same problem (measured speedup: 2.4076071971408854x):
#include<iostream>

#include<math.h>

#include<algorithm>

#define LL long long

#define FIO ios_base::sync_with_stdio(false), cin.tie(0)

using namespace std;



bool isPrime(int x)

{

	for(int i=2; i*i<=x; i++) if(x%i==0) return false;

	return true;

}



int main()

{

	int x, i; cin>>x;

	if(x==2) { cout<<2<<endl; return 0; }

	

	for(i=x; ; i++)

	{

		if(isPrime(i)) break;

	}

	cout<<i<<endl;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;

typedef long long ll ;

const int N =  1e5 ;

int main()

{

    vector<int>primes;

    int vis[100001];

    memset(vis , 0 , sizeof vis);

    for(int i =2 ; i <= N ; i++)

    {

        if(!vis[i])

        {

            primes.push_back(i);

            for(int j = i+i ; j <= N ;j+=i)

            {

                vis[j]=1;

            }

        }

    }

    primes.push_back(100003);

    ll n;

    cin >> n;

    cout << *lower_bound(primes.begin(),primes.end(),n) ;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 2.5921655833173705x):
#include<iostream>

#include<math.h>

#include<algorithm>

#define LL long long

#define FIO ios_base::sync_with_stdio(false), cin.tie(0)

using namespace std;



bool isPrime(int x)

{

	for(int i=2; i*i<=x; i++) if(x%i==0) return false;

	return true;

}



int main()

{

	int x, i; cin>>x;

	if(x==2) { cout<<2<<endl; return 0; }

	

	for(i=x; ; i++)

	{

		if(isPrime(i)) break;

	}

	cout<<i<<endl;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



int X;



int sieve_of_eratosthenes() {

  vector<bool> is_prime(100003, true);

  is_prime[0] = is_prime[1] = false;

  for(int i=2; i<=X; i++)

    if(is_prime[i]) {

      for(int k=2; k * i <= 100003; k++)

        is_prime[k*i] = false;

    }

  for(int i=X; i<=100003; i++)

    if(is_prime[i]) return i;

  return 0;

}



signed main() {

  cin >> X;

  cout << sieve_of_eratosthenes() << endl;

}


// Faster C++ solution for the same problem (measured speedup: 1.2822863131557967x):
#include<bits/stdc++.h>

using namespace std;



vector<bool> sieve_of_eratosthenes(int n) {

  /* O(n log log n) */

  vector<bool> is_prime(n, true);

  is_prime[0] = is_prime[1] = false;

  for(int i=2; i<=n; i++)

    if(is_prime[i]) 

      for(int k=2; k * i <= n; k++)

        is_prime[k*i] = false;

  return is_prime;

}



vector<int> prime_list(int n) {

  /* O(n log log n) */

  auto is_prime = sieve_of_eratosthenes(n);

  vector<int> primes;

  for(int i=0; i<=n; i++) 

    if(is_prime[i]) 

      primes.push_back(i);

  return primes;

}



map<int, int> prime_factorization(int n) {

  /* O(n log log n) */

  auto primes = prime_list((int)ceil(sqrt(n)));

  map<int,int> factors;

  for(auto i : primes) {

    while (n%i==0) {

      factors[i]++;

      n /= i;

    }

  }

  if(n!=1) factors[n]++;

  return factors;

}



bool is_prime(int n){

  /* O(log n) */

  if(n<=1) return false;

  for(int i=2;i*i<=n;i++) if(n%i==0) return false;

  return true;

}



signed main() {

#if 0

  // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0009

  const int n_max = 999999;

  auto is_prime = sieve_of_eratosthenes(n_max);

  vector<int> csum(n_max, 0);

  for(int i=2; i<=n_max; i++) 

    csum[i] = csum[i-1] + (is_prime[i] ? 1 : 0);



  int n;

  while(cin >> n) cout << csum[n] << endl;



#elif 0

  // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=NTL_1_A

  int n;

  cin >> n;

  cout << n << ":";

  auto factors = prime_factorization(n);

  for(auto f : factors) for(int i=0; i<f.second; i++) cout << " " << f.first;

  cout << endl;



#else

  // https://atcoder.jp/contests/abc149/tasks/abc149_c

  int x;

  cin>>x;



  int p=x;

  while(!is_prime(p)) p++;



  cout << p << endl;

#endif

}