stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include<iostream>

#include<string>

#include<algorithm>

#include<cstdlib>

#include<stack>

#include<queue>

#include<vector>

using namespace std;

bool arr[100100];

vector<long long int>v;

void sieve()

{

    long long int a, b, c, i, j, k;

    v.push_back(2);

    for (i = 3; i * i <= 100050; i = i + 2)

    {

        if (arr[i] == false)

        {

            v.push_back(i);

            for (j = i * i; j <= 100050; j = j + i)

            {

                arr[j] = true;

            }

        }

    }

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

    {

        if (arr[i] == false)

            v.push_back(i);

    }



}

int main()

{

	long long int a, b, c, d, i, j, k, m, l, t;

    sieve();

    cin >> a;

    l = 0;

    long long int h = v.size() - 1;

   auto it= lower_bound(v.begin(), v.end(), a);

   b = it - v.begin();

   cout << v[b] << endl;

  

    return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>



int isPrime(int x)

{

    int i;

    if(x==2)

        return 1;

    if(x%2==0)

        return 0;

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

    {

        if(x%i==0)

            return 0;

    }

    return 1;

}



int main()

{

    int n, i;

    scanf("%d", &n);



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

    {

        if(isPrime(i))

        {

            printf("%d\n", i);

            break;

        }

    }



    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

	int n;

	cin>>n;

	while(1)

	{

		bool k = 0;

		for(int i=2;i*i<=n;i++) if(!(n%i)) {

			k = 1;

			break;

		}

		if(!k) cout<<n,exit(0);

		n++;

	}

}

// Optimized solution to the same problem (faster):
#include <stdio.h>



int isPrime(int x)

{

    int i;

    if(x==2)

        return 1;

    if(x%2==0)

        return 0;

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

    {

        if(x%i==0)

            return 0;

    }

    return 1;

}



int main()

{

    int n, i;

    scanf("%d", &n);



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

    {

        if(isPrime(i))

        {

            printf("%d\n", i);

            break;

        }

    }



    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>



using namespace std;



void prime(int n){

    int i,c=0;

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

        if(n%i==0){

            c++;

            break;

        }

    }

    if(c==0){

        cout<<n;

        exit(0);

    }

}



int main(){

    int n,i;

    cin>>n;

    i=n;

    while(i>=n){

        prime(i);

        i++;

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>



int isPrime(int x)

{

    int i;

    if(x==2)

        return 1;

    if(x%2==0)

        return 0;

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

    {

        if(x%i==0)

            return 0;

    }

    return 1;

}



int main()

{

    int n, i;

    scanf("%d", &n);



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

    {

        if(isPrime(i))

        {

            printf("%d\n", i);

            break;

        }

    }



    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main()

{

	int i,j,n,count;

	cin>>n;

	for(j=n;j<n+1000;j++)

	{

	count=0;

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

	{

		if(j%i==0)

		count+=1;

		

	}

		if (count==0)

		{

		cout<<j;

		exit(0);

		}

	}

	return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>



int isPrime(int x)

{

    int i;

    if(x==2)

        return 1;

    if(x%2==0)

        return 0;

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

    {

        if(x%i==0)

            return 0;

    }

    return 1;

}



int main()

{

    int n, i;

    scanf("%d", &n);



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

    {

        if(isPrime(i))

        {

            printf("%d\n", i);

            break;

        }

    }



    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;

int prime(int n) 

{ 

    if (n <= 1) 

        return 0; 

  

   

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

        if (n % i == 0) 

            return 0; 

  

    return 1; 

} 

int main()

{

   int n=0,x,a,b;

    cin>>x;

    



    for (int i = x;; i++) 

    {

       int d=prime(i);

        if(d)

        {

            cout<<i;

            break;

        }

    }

    

    

    return 0;

}




// Optimized solution to the same problem (faster):
#include <stdio.h>



int isPrime(int x)

{

    int i;

    if(x==2)

        return 1;

    if(x%2==0)

        return 0;

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

    {

        if(x%i==0)

            return 0;

    }

    return 1;

}



int main()

{

    int n, i;

    scanf("%d", &n);



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

    {

        if(isPrime(i))

        {

            printf("%d\n", i);

            break;

        }

    }



    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define     sc(a)       scanf("%d",&a)

#define     sc2(a,b)    scanf("%d%d",&a,&b)

#define     line        "\n"

#define     space       " "

#define     MAX         100010

#define     MOD         1000000007

#define     Q           int nn ; scanf("%d",&nn); for (int xx=0;xx<nn;xx++)

#define     ff          first

#define     ss          second

#define     pf(a)       printf("%d\n",a)

#define     pfs(a)      printf("%d ",a)

#define     pf2(a,b)    printf("%d %d\n",a,b)

#define     itm(it)     map<int,int>:: iterator it

#define     its(it)     set<int>:: iterator it

#define     ac_sort(v)  sort(v.begin(),v.end())

#define     dc_sort(v)  sort(v.rbegin(),v.rend())

typedef long long lld;

using namespace std;

int main()

{

    int n ; sc(n);

    bool f =0, flag =0;

    while (n){

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

            if (n%x==0) flag=1;

        }

        if (flag==0){

            break;

        }

        else flag=0,n++;

    }

    pf(n);

}


// Optimized solution to the same problem (faster):
#include <stdio.h>



int isPrime(int x)

{

    int i;

    if(x==2)

        return 1;

    if(x%2==0)

        return 0;

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

    {

        if(x%i==0)

            return 0;

    }

    return 1;

}



int main()

{

    int n, i;

    scanf("%d", &n);



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

    {

        if(isPrime(i))

        {

            printf("%d\n", i);

            break;

        }

    }



    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int x,i,flag;

    cin>>x;

    while(1)

    {

        flag=0;

        if(x==2)

        {

            cout<<x;

            break;

        }

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

        {

            if(x%i==0)

            {

                flag=1;

                break;

            }



        }

        if(flag==0)

        {

            cout<<x;

            break;

        }

        else

            x++;



    }

}


// Optimized solution to the same problem (faster):
#include <stdio.h>



int isPrime(int x)

{

    int i;

    if(x==2)

        return 1;

    if(x%2==0)

        return 0;

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

    {

        if(x%i==0)

            return 0;

    }

    return 1;

}



int main()

{

    int n, i;

    scanf("%d", &n);



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

    {

        if(isPrime(i))

        {

            printf("%d\n", i);

            break;

        }

    }



    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#include<string.h>

#include<cstring>

#define pb push_back

#define FAST ios::sync_with_stdio(0);cin.tie(),cout.tie();

typedef long long ll;

const long double pi = acos(-1.0);

const int mod = 1e9+7;

using namespace std;

 int is_prime(int n)

 {

     int i, root;

     if(n == 2) {

         return 1;

     }

     if(n % 2 == 0) {

         return 0;

     }

     root = sqrt(n);

     for(i = 3; i <= root; i = i + 2) {

         if(n % i == 0) {

             return 0;

         }

     }

     return 1;

 }



 int main()

 {

     int n, m,i;

         scanf("%d", &n);

         for( i=n;;i++)

         {

             if(is_prime(i))

                break;

         }



     cout<<i<<endl;

     return 0;

 }


// Optimized solution to the same problem (faster):
#include <stdio.h>



int isPrime(int x)

{

    int i;

    if(x==2)

        return 1;

    if(x%2==0)

        return 0;

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

    {

        if(x%i==0)

            return 0;

    }

    return 1;

}



int main()

{

    int n, i;

    scanf("%d", &n);



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

    {

        if(isPrime(i))

        {

            printf("%d\n", i);

            break;

        }

    }



    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

bool p(int n)

{

    if (n == 3 || n==2)

        {return true;}

    if (n%2 == 0 || n%3 == 0)

        {return false;}



    for (int i=5; i*i<=n; i=i+6)

    {

        if (n%i == 0 || n%(i+2) == 0)

        {

            return false;

        }

    }

    return true;

}

int np(int n)

{

    int prime = n;

    bool x = false;

    while (!x)

    {

        prime++;



        if (p(prime))

            {x= true;}

    }



    return prime;

}





int main()

{

    int n;

    cin>>n;

    if(p(n))

    {

        cout<<n<<endl;

        return 0;

    }

    else

    cout << np(n);

    return 0;}


// Optimized solution to the same problem (faster):
#include <stdio.h>



int isPrime(int x)

{

    int i;

    if(x==2)

        return 1;

    if(x%2==0)

        return 0;

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

    {

        if(x%i==0)

            return 0;

    }

    return 1;

}



int main()

{

    int n, i;

    scanf("%d", &n);



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

    {

        if(isPrime(i))

        {

            printf("%d\n", i);

            break;

        }

    }



    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <stdlib.h>

#include <string.h>



using namespace std;



int prime(long n);



int main()

{

    long n;

    cin>>n;

    /*if(n==2 || n==3)

    {

        cout<<n;

        return 0;

    }*/

    while(1)

    {

        if(prime(n))

        {

            cout<<n;

            break;

        }

        else

        {

            if(n%2)

        {

            n+=2;

        }

        else

            n++;

        }

    }



    return 0;

}

int prime(long n)

{

    long i;

    int flag=1;

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

    {

        if(!(n%i))

        {

            flag=0;

            break;

        }

    }

    return flag;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>



int isPrime(int x)

{

    int i;

    if(x==2)

        return 1;

    if(x%2==0)

        return 0;

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

    {

        if(x%i==0)

            return 0;

    }

    return 1;

}



int main()

{

    int n, i;

    scanf("%d", &n);



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

    {

        if(isPrime(i))

        {

            printf("%d\n", i);

            break;

        }

    }



    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
// https://atcoder.jp/contests/abc149/tasks/abc149_c

#include <bits/stdc++.h>

using namespace std;

#define int long long

#define REP(i, n) FOR(i, 0, n)

#define REPR(i, n) for (int i = n - 1; i >= 0; i--)

#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)

#define ALL(obj) (obj).begin(), (obj).end()

#define ALLR(obj) (obj).rbegin(), (obj).rend()

#define DIV(a, b) ((a - 1) / b + 1)



const int SZ = 1e5 + 10;



// constexprな素数列挙(エラトステネスの篩)

// https://259-momone.hatenablog.com/entry/2018/05/06/015026

template <int N> struct Prime {

    bool b[N + 1]; // trueなら素数

    constexpr Prime() : b() {

        for (int_fast64_t i = 0; i <= N; ++i)

            b[i] = true;

        b[0] = b[1] = false;

        for (int_fast64_t i = 2; i <= N; ++i) {

            for (int_fast64_t j = i * i; j <= N; j += i)

                b[j] = false;

        }

    }

};



signed main() {

    ios::sync_with_stdio(false);

    cin.tie(0);

    int X;

    cin >> X;

    constexpr auto prime = Prime<SZ>();

    while (true) {

        if (prime.b[X]) {

            cout << X << endl;

            break;

        }

        X++;

    }

    return 0;

}


// Optimized solution to the same problem (faster):
// https://atcoder.jp/contests/abc149/tasks/abc149_c

#include <bits/stdc++.h>

using namespace std;

#define int long long

#define REP(i, n) FOR(i, 0, n)

#define REPR(i, n) for (int i = n - 1; i >= 0; i--)

#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)

#define ALL(obj) (obj).begin(), (obj).end()

#define ALLR(obj) (obj).rbegin(), (obj).rend()

#define DIV(a, b) ((a - 1) / b + 1)



const int SZ = 1e5 + 10;



// constexprな素数列挙(エラトステネスの篩)

// https://259-momone.hatenablog.com/entry/2018/05/06/015026

template <int N> struct Prime {

    bool b[N + 1]; // trueなら素数

    constexpr Prime() : b() {

        for (int_fast64_t i = 0; i <= N; ++i)

            b[i] = true;

        b[0] = b[1] = false;

        for (int_fast64_t i = 2; i <= N; ++i) {

            for (int_fast64_t j = i * i; j <= N; j += i)

                b[j] = false;

        }

    }

};

Prime<SZ> prime;



signed main() {

    ios::sync_with_stdio(false);

    cin.tie(0);

    int X;

    cin >> X;

    while (true) {

        if (prime.b[X]) {

            cout << X << endl;

            break;

        }

        X++;

    }

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

    }

}

// Optimized solution to the same problem (faster):
#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;











}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;











}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

typedef long long int lli;

using namespace std;

int check(lli n){

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

        if(n%i==0) return 0;

    }

    return 1;

}

int main(){

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);cout.tie(NULL);\

    lli n;

    cin>>n;

    if(check(n)==1){

            cout<<n;

            return 0;

        }

    while(n++){

        if(check(n)==1){

            cout<<n;

            return 0;

        }

    }

	return 0;

}


// Optimized solution to the same problem (faster):
#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;











}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include<bits/stdc++.h>

using namespace std;

void print(vector<int>vec,int n){

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

        cout<<vec[i]<<" ";

    }

}



bool isPrime(int n){

    

    int i;

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

        if(!(n%i)){

            break;

        }

    }

    if(i<=sqrt(n)){

        return 0;

    }

    return 1;

}



int nextPrime(int N){

    bool x = 0;

    int i=1;

    while(!x){

        if(isPrime(N+i)){

            x=1;

        }

        i++;

    }

    return N+i-1;

}



int main()

{

    int n;

    cin>>n;

    bool a = isPrime(n);

    if(a){

        cout<<n<<endl;

    }

    else{

        cout<<nextPrime(n)<<endl;

    }

    

    

}

// Optimized solution to the same problem (faster):
#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;











}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main()

{

int n,i,j;

cin>>n;

for(j=n;;j++)

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

{

   if(j%i==0)

    break;

    

    

}

if(i==(n/2)+1)

break;

}

cout<<j;

return 0;

}

// Optimized solution to the same problem (faster):
#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;











}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

bool isPrime(int n) {

  if (n < 2) return false;

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

    if (n % i == 0) {

      return false;

    }

  }

  return true;

}

int main(){

    int n;

    cin>>n;

    if(isPrime(n)==true){

        cout<<n<<endl;

        return 0;

    }

    else {

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

            if(isPrime(i)==true){

                cout<<i<<endl;

                return 0;

            }

        }

    }

}


// Optimized solution to the same problem (faster):
#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;











}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



bool isPrime(int p)

{

    if (p <= 1)

        return false;

    if (p<= 3)

     return true;

    if (p%2 == 0 || p%3 == 0)

         return false;



    for (int i=5; i*i<=p; i=i+2)

        if (p%i == 0 || p%(i+2) == 0)

           return false;



    return true;

}

int nextPrime(int P)

{

    if (P <= 1)

        return 2;



    int prime = P;

    bool rslt = false;

    while (!rslt) {

        prime++;



        if (isPrime(prime))

            rslt = true;



    }



    return prime;

}

int main()

{

    int P;

    cin>>P;



           if(isPrime(P))

             cout<<P;

           else

              cout << nextPrime(P);

  return 0;

}


// Optimized solution to the same problem (faster):
#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;











}


// Fastest known solution for this problem: