stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <cstdlib>



using namespace std;



#define N 200008



int n;

int a[N],b[N];



void solve()

{

	int len = 0;

	for (int i = n; i>= 1; i-=2)

		b[++len] = a[i];

	for (int i = n-1,len = n; i >= 1; i-=2)

		b[len--] = a[i];

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

		printf("%d ", b[i]);

	printf("\n");

}



void init()

{

	scanf("%d", &n);

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

		scanf("%d", &a[i]);

}



int main()

{

	init();

	solve();

	return 0; 

} 

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

#include <string.h>

#define MAXN 100005



int main()

{

    int n;

    while(scanf("%d", &n) != EOF)

    {

        int a,num = n,flag = 1;

        int head[MAXN],tail[MAXN];

        int num_i = 0, num_j = 0;

        while(num--)

        {

            scanf("%d", &a);

            if(flag)

                tail[num_j++] = a;

            else

                head[num_i++] = a;

            flag = !flag;

        }

        if(n%2 == 0)

        {

            for(int i = num_i - 1; i >= 0; i--)

            {

                printf("%d ", head[i]);

            }

            for(int j = 0; j < num_j - 1; j++)

            {

                printf("%d ", tail[j]);

            }

            if(num_j)printf("%d\n", tail[num_j - 1]);

            else printf("\n");

        }

        else

        {

            for(int j = num_j - 1; j >= 0; j--)

            {

                printf("%d ", tail[j]);

            }

            for(int i = 0; i < num_i - 1; i++)

            {

                printf("%d ", head[i]);

            }

            if(num_i)printf("%d\n", head[num_i - 1]);

            else printf("\n");

        }

    }

    return 0;

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



using namespace std;



const int MAXN = 2*(1e5 + 100);



int main () {

	int n, a[MAXN], b[MAXN];

	scanf ("%d", &n);

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

		scanf ("%d", &a[i]);

	int m = n >> 1;

	for (int i = 1; i <= m; i ++) {

		b[i] = a[n - (i << 1) + 2];

		b[n - i + 1] = a[n - (i << 1) + 1];

	}

	if (n & 1)

		b[m + 1] = a[1];

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

		printf ("%d ", b[i]);

	printf ("%d\n", b[n]);

	return 0;

}

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

#include <string.h>

#define MAXN 100005



int main()

{

    int n;

    while(scanf("%d", &n) != EOF)

    {

        int a,num = n,flag = 1;

        int head[MAXN],tail[MAXN];

        int num_i = 0, num_j = 0;

        while(num--)

        {

            scanf("%d", &a);

            if(flag)

                tail[num_j++] = a;

            else

                head[num_i++] = a;

            flag = !flag;

        }

        if(n%2 == 0)

        {

            for(int i = num_i - 1; i >= 0; i--)

            {

                printf("%d ", head[i]);

            }

            for(int j = 0; j < num_j - 1; j++)

            {

                printf("%d ", tail[j]);

            }

            if(num_j)printf("%d\n", tail[num_j - 1]);

            else printf("\n");

        }

        else

        {

            for(int j = num_j - 1; j >= 0; j--)

            {

                printf("%d ", tail[j]);

            }

            for(int i = 0; i < num_i - 1; i++)

            {

                printf("%d ", head[i]);

            }

            if(num_i)printf("%d\n", head[num_i - 1]);

            else printf("\n");

        }

    }

    return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;



int a[200000];

int n,i;

void init()

{

    cin >> n;

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

    {

		cin >> a[i];

	}

}

int main()

{

    init();

	for (i=n-1; i>=0; i-=2)

    {

		cout << a[i] << " ";

	}

	i++;

	if (n % 2) i += 2;

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

	{

        cout << a[i] << " ";

	}

	return 0;

}

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

#include <string.h>

#define MAXN 100005



int main()

{

    int n;

    while(scanf("%d", &n) != EOF)

    {

        int a,num = n,flag = 1;

        int head[MAXN],tail[MAXN];

        int num_i = 0, num_j = 0;

        while(num--)

        {

            scanf("%d", &a);

            if(flag)

                tail[num_j++] = a;

            else

                head[num_i++] = a;

            flag = !flag;

        }

        if(n%2 == 0)

        {

            for(int i = num_i - 1; i >= 0; i--)

            {

                printf("%d ", head[i]);

            }

            for(int j = 0; j < num_j - 1; j++)

            {

                printf("%d ", tail[j]);

            }

            if(num_j)printf("%d\n", tail[num_j - 1]);

            else printf("\n");

        }

        else

        {

            for(int j = num_j - 1; j >= 0; j--)

            {

                printf("%d ", tail[j]);

            }

            for(int i = 0; i < num_i - 1; i++)

            {

                printf("%d ", head[i]);

            }

            if(num_i)printf("%d\n", head[num_i - 1]);

            else printf("\n");

        }

    }

    return 0;

}
// Slower C++ solution:
#include<iostream>



using namespace std;



int main()

{

	int n,k;

	long long int*a;

	int temp=1;

	cin>>n; 

	k=n/2;

	a = new long long int[n];

	if(n-2*k)

	{

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

			

			if(temp==1)

			{

				cin>>a[k];

				temp++;

			}

			else 

			{

				if(temp%2==1)

					cin>>a[k-temp/2];

				else

					cin>>a[k+temp/2];

				temp++;

			}

		}

 	}

 	else

 	{

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

			

			if(temp==1)

			{

				cin>>a[k];

				temp++;

			}

			else 

			{

				if(temp%2==0)

					cin>>a[k-temp/2];

				else

					cin>>a[k+temp/2];

				temp++;

			}

		}

	 }

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

	 	cout<<a[i]<<' ';

	return 0;

 }

  

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

#include <string.h>

#define MAXN 100005



int main()

{

    int n;

    while(scanf("%d", &n) != EOF)

    {

        int a,num = n,flag = 1;

        int head[MAXN],tail[MAXN];

        int num_i = 0, num_j = 0;

        while(num--)

        {

            scanf("%d", &a);

            if(flag)

                tail[num_j++] = a;

            else

                head[num_i++] = a;

            flag = !flag;

        }

        if(n%2 == 0)

        {

            for(int i = num_i - 1; i >= 0; i--)

            {

                printf("%d ", head[i]);

            }

            for(int j = 0; j < num_j - 1; j++)

            {

                printf("%d ", tail[j]);

            }

            if(num_j)printf("%d\n", tail[num_j - 1]);

            else printf("\n");

        }

        else

        {

            for(int j = num_j - 1; j >= 0; j--)

            {

                printf("%d ", tail[j]);

            }

            for(int i = 0; i < num_i - 1; i++)

            {

                printf("%d ", head[i]);

            }

            if(num_i)printf("%d\n", head[num_i - 1]);

            else printf("\n");

        }

    }

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cstdio> 

using namespace std;

int n, a[200005];

int main()

{

	while(cin >> n)

	{

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

		{

			scanf("%d", &a[i]);

		}

		printf("%d", a[n]);

		for(int i = n-2; i >= 1; i -= 2) printf(" %d", a[i]);

		for(int i = (n % 2)?2:1; i <= n-1; i += 2) printf(" %d", a[i]);

		printf("\n");

	}

    return 0;

}

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

#include <string.h>

#define MAXN 100005



int main()

{

    int n;

    while(scanf("%d", &n) != EOF)

    {

        int a,num = n,flag = 1;

        int head[MAXN],tail[MAXN];

        int num_i = 0, num_j = 0;

        while(num--)

        {

            scanf("%d", &a);

            if(flag)

                tail[num_j++] = a;

            else

                head[num_i++] = a;

            flag = !flag;

        }

        if(n%2 == 0)

        {

            for(int i = num_i - 1; i >= 0; i--)

            {

                printf("%d ", head[i]);

            }

            for(int j = 0; j < num_j - 1; j++)

            {

                printf("%d ", tail[j]);

            }

            if(num_j)printf("%d\n", tail[num_j - 1]);

            else printf("\n");

        }

        else

        {

            for(int j = num_j - 1; j >= 0; j--)

            {

                printf("%d ", tail[j]);

            }

            for(int i = 0; i < num_i - 1; i++)

            {

                printf("%d ", head[i]);

            }

            if(num_i)printf("%d\n", head[num_i - 1]);

            else printf("\n");

        }

    }

    return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main()

{const int size=2e+5;

int a[size],b[size];

int n;

cin>>n;



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

{cin>>a[i];

}



for(int i=n-1,j=0,k=n-1;i>-1;i--)

{

	

	

	b[j++]=a[i--];

	

	if(i<0)

	break;

	

	b[k--]=a[i];



}





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

{cout<<b[i]<<" ";

}

return 0;

 } 

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

#include <string.h>

#define MAXN 100005



int main()

{

    int n;

    while(scanf("%d", &n) != EOF)

    {

        int a,num = n,flag = 1;

        int head[MAXN],tail[MAXN];

        int num_i = 0, num_j = 0;

        while(num--)

        {

            scanf("%d", &a);

            if(flag)

                tail[num_j++] = a;

            else

                head[num_i++] = a;

            flag = !flag;

        }

        if(n%2 == 0)

        {

            for(int i = num_i - 1; i >= 0; i--)

            {

                printf("%d ", head[i]);

            }

            for(int j = 0; j < num_j - 1; j++)

            {

                printf("%d ", tail[j]);

            }

            if(num_j)printf("%d\n", tail[num_j - 1]);

            else printf("\n");

        }

        else

        {

            for(int j = num_j - 1; j >= 0; j--)

            {

                printf("%d ", tail[j]);

            }

            for(int i = 0; i < num_i - 1; i++)

            {

                printf("%d ", head[i]);

            }

            if(num_i)printf("%d\n", head[num_i - 1]);

            else printf("\n");

        }

    }

    return 0;

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

using namespace std;



deque<int> Q;



int main() {

    int n, num;

    cin >> n;

    bool flag = 1;

    while (n--) {

        scanf("%d", &num);

        if (flag)

            Q.push_front(num);

        else

            Q.push_back(num);

        flag = !flag;

    }

    if (!flag) {

        for (auto i = Q.begin(); i != Q.end(); i++) {

            if (i == Q.begin())

                cout << *i;

            else

                cout << " " << *i;

        }

        cout << endl;

    } else {

        for (auto i = Q.rbegin(); i < Q.rend(); i++) {

            if (i == Q.rbegin())

                cout << *i;

            else

                cout << " " << *i;

        }

        cout << endl;

    }

    cout << endl;

    return 0;

}

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

#include <string.h>

#define MAXN 100005



int main()

{

    int n;

    while(scanf("%d", &n) != EOF)

    {

        int a,num = n,flag = 1;

        int head[MAXN],tail[MAXN];

        int num_i = 0, num_j = 0;

        while(num--)

        {

            scanf("%d", &a);

            if(flag)

                tail[num_j++] = a;

            else

                head[num_i++] = a;

            flag = !flag;

        }

        if(n%2 == 0)

        {

            for(int i = num_i - 1; i >= 0; i--)

            {

                printf("%d ", head[i]);

            }

            for(int j = 0; j < num_j - 1; j++)

            {

                printf("%d ", tail[j]);

            }

            if(num_j)printf("%d\n", tail[num_j - 1]);

            else printf("\n");

        }

        else

        {

            for(int j = num_j - 1; j >= 0; j--)

            {

                printf("%d ", tail[j]);

            }

            for(int i = 0; i < num_i - 1; i++)

            {

                printf("%d ", head[i]);

            }

            if(num_i)printf("%d\n", head[num_i - 1]);

            else printf("\n");

        }

    }

    return 0;

}
// Slower C++ solution:
#include<map>

#include<stack>

#include<cmath>

#include<queue>

#include<cstdio>

#include<cstring>

#include<cstdlib>

#include<iostream>

#include<algorithm>

using namespace std;

#define ll long long

int a[210000],b[210000];

int main()

{

    int n;

    while(scanf("%d",&n)!=EOF)

    {

        int i,j,q=1,flag=1,k=0;

        memset(a,0,sizeof(a));

        memset(b,0,sizeof(b));

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

        {

            scanf("%d",&a[i]);

        }

        if(n%2==0)

        {

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

            {

                b[i]=a[n-k];

                k+=2;

            }

            for(i=n; i>n/2; i--)

            {

                b[i]=a[n-q];

                q+=2;

            }

        }

        else

        {

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

            {

                b[i]=a[n-k];

                k+=2;

            }

            for(i=n;i>(n+1)/2;i--)

            {

                b[i]=a[n-q];

                q+=2;

            }

        }

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

        {

            if(i==1)

                printf("%d",b[i]);

            else

                printf(" %d",b[i]);

        }



        printf("\n");

    }

    return 0;

}

/*

4 2 1 3

*/


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

using namespace std;



int a[200010];



int main()

{

    int n;

    while(scanf("%d",&n)!=EOF)

    {

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

            scanf("%d",&a[i]);



        if(n%2)

        {

            for(int i=n;i>=1;i-=2)

            {

                printf("%d ",a[i]);

            }

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

            {

                printf("%d ",a[i]);

            }

            printf("\n");

        }

        else

        {

            for(int i=n;i>=1;i-=2)

            {

                printf("%d ",a[i]);



            }

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

            {

                printf("%d ",a[i]);

            }

                        printf("\n");



        }

    }

}
// Slower C++ solution:
#include<map>

#include<stack>

#include<cmath>

#include<queue>

#include<cstdio>

#include<cstring>

#include<cstdlib>

#include<iostream>

#include<algorithm>

using namespace std;

#define ll long long

int a[210000],b[210000];

int main()

{

    int n;

    while(scanf("%d",&n)!=EOF)

    {

        int i,j,q=1,flag=1,k=0;

        memset(a,0,sizeof(a));

        memset(b,0,sizeof(b));

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

        {

            scanf("%d",&a[i]);

        }

        if(n%2==0)

        {

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

            {

                b[i]=a[n-k];

                k+=2;

            }

            for(i=n; i>n/2; i--)

            {

                b[i]=a[n-q];

                q+=2;

            }

        }

        else

        {

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

            {

                b[i]=a[n-k];

                k+=2;

            }

            for(i=n;i>(n+1)/2;i--)

            {

                b[i]=a[n-q];

                q+=2;

            }

        }

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

        {

            if(i==1)

                printf("%d",b[i]);

            else

                printf(" %d",b[i]);

        }



        printf("\n");

    }

    return 0;

}

/*

4 2 1 3

*/


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

#include "deque"

#include "vector"

using namespace std;

typedef long long ll;

int main()

{

    ll n,x;

    cin >> n;

    deque<ll> deq;

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

        cin >> x;

        if (i%2==0)

        deq.push_back(x);

        else deq.push_front(x);

    }

    bool flag=false;

    if (n%2==0){

        for(int i=0;i<deq.size();i++){

            if (flag) cout << " ";

            flag=true;

            cout << *(i+deq.begin());

        }

    }else {

        for (int i=deq.size()-1;i>=0;i--){

           if (flag) cout << " ";

            flag=true;

          cout << *(i+deq.begin());

    }

    }



    return 0;

}
// Slower C++ solution:
#include<map>

#include<stack>

#include<cmath>

#include<queue>

#include<cstdio>

#include<cstring>

#include<cstdlib>

#include<iostream>

#include<algorithm>

using namespace std;

#define ll long long

int a[210000],b[210000];

int main()

{

    int n;

    while(scanf("%d",&n)!=EOF)

    {

        int i,j,q=1,flag=1,k=0;

        memset(a,0,sizeof(a));

        memset(b,0,sizeof(b));

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

        {

            scanf("%d",&a[i]);

        }

        if(n%2==0)

        {

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

            {

                b[i]=a[n-k];

                k+=2;

            }

            for(i=n; i>n/2; i--)

            {

                b[i]=a[n-q];

                q+=2;

            }

        }

        else

        {

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

            {

                b[i]=a[n-k];

                k+=2;

            }

            for(i=n;i>(n+1)/2;i--)

            {

                b[i]=a[n-q];

                q+=2;

            }

        }

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

        {

            if(i==1)

                printf("%d",b[i]);

            else

                printf(" %d",b[i]);

        }



        printf("\n");

    }

    return 0;

}

/*

4 2 1 3

*/


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

#include<stack>

#include<string.h>

#include<stdio.h>

#include<queue>

#include<math.h>

using namespace std;

long long int a[300000];

long long int b[300000];

int main(void)

{

    int n;

    scanf("%d",&n);

    int i,j;

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

    {

        scanf("%lld",&a[i]);

    }

    for(i=n-1,j=0; i>=0; i=i-2,j++)

    {

        b[j]=a[i];

    }

    for(j=n-1,i=n-2; i>=0; j--,i=i-2)

    {

        b[j]=a[i];

    }

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

        printf("%lld ",b[i]);

    }
// Slower C++ solution:
#include<map>

#include<stack>

#include<cmath>

#include<queue>

#include<cstdio>

#include<cstring>

#include<cstdlib>

#include<iostream>

#include<algorithm>

using namespace std;

#define ll long long

int a[210000],b[210000];

int main()

{

    int n;

    while(scanf("%d",&n)!=EOF)

    {

        int i,j,q=1,flag=1,k=0;

        memset(a,0,sizeof(a));

        memset(b,0,sizeof(b));

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

        {

            scanf("%d",&a[i]);

        }

        if(n%2==0)

        {

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

            {

                b[i]=a[n-k];

                k+=2;

            }

            for(i=n; i>n/2; i--)

            {

                b[i]=a[n-q];

                q+=2;

            }

        }

        else

        {

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

            {

                b[i]=a[n-k];

                k+=2;

            }

            for(i=n;i>(n+1)/2;i--)

            {

                b[i]=a[n-q];

                q+=2;

            }

        }

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

        {

            if(i==1)

                printf("%d",b[i]);

            else

                printf(" %d",b[i]);

        }



        printf("\n");

    }

    return 0;

}

/*

4 2 1 3

*/


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

using namespace std;

#define X first

#define Y second

#define mp make_pair

#define pb push_back

#define il inline

#define rg register

#define eprintf(...) fprintf(stderr,__VA_ARGS__)

#define lch(x) ((x)<<1)

#define rch(x) ((x)<<1^1)

#define rep(i,st,ed) for(rg int i=(st);i<=(ed);++i)

#define per(i,ed,st) for(rg int i=(ed);i>=(st);--i)

#define rep0(i,n) for(rg int i=0;i<(n);++i)

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

typedef long long ll;

typedef unsigned long long ull;

typedef unsigned int uint;

typedef double dbl;

typedef long double ldb;

typedef pair<int,int> pii;

typedef pair<ll,ll> pll;

template<typename T> il T qmin(const T &x,const T &y){return x<y?x:y;}

template<typename T> il T qmax(const T &x,const T &y){return x>y?x:y;}

template<typename T> il bool getmin(T &x,const T &y){return y<x?x=y,true:false;}

template<typename T> il bool getmax(T &x,const T &y){return y>x?x=y,true:false;}

il void fileio(const string &s){

	freopen((s+".in").c_str(),"r",stdin);

	freopen((s+".out").c_str(),"w",stdout);

}



const int inf=(int)1e9+7;

const ll linf=(ll)1e18+7;

const int N=400005;



int a[N],n;



int main(){

//	fileio("test");

	scanf("%d",&n);

	int l=N/2,r=l-1;

	rep(i,1,n){

		int x;

		scanf("%d",&x);

		if(i&1) a[++r]=x;else a[--l]=x;

	}

	if(n&1){

		per(i,r,l) printf("%d ",a[i]);puts("");

	}else{

		rep(i,l,r) printf("%d ",a[i]);puts("");

	}

	return 0;

}
// Slower C++ solution:
#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <deque>

#include <iostream>

#include <vector>

using namespace std;



const int N = 2e5;

deque<int> q;



int n;



int main()

{

    scanf("%d", &n);

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

    {

        int x;

        scanf("%d", &x);

        if (i & 1)

            q.push_back(x);

        else

            q.push_front(x);

    }

    if ((n & 1) == 0)

    {

        for (deque<int>::iterator it = q.begin(); it != q.end(); ++it)

        {

            printf("%d ", *it);

        }

        return 0;

    }

    else

    {

        deque<int>::iterator it = q.end();

        --it;

        for (; it != q.begin(); --it)

        {

            printf("%d ", *it);

        }

        printf("%d\n", q.front());

        return 0;

    }

    return 0;

}

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

#include<string.h>

#include<string>

#include<math.h>

#include<map>

#include<vector>

#include<queue>

#include<set>

#include<algorithm>

using namespace std;

int a[200010];

int main(){

    int n;

    while(~scanf("%d",&n)){

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

            scanf("%d",&a[i]);

        }

        if(n==1) printf("%d\n",a[1]);

        else{

            if(n%2==0){

                for(int i=n;i>0;i-=2){

                    printf("%d ",a[i]);

                }

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

                    printf("%d ",a[i]);

                }

                printf("%d\n",a[n-1]);

            }

            else{

                for(int i=n;i>0;i-=2){

                    printf("%d ",a[i]);

                }

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

                    printf("%d ",a[i]);

                }

                printf("%d\n",a[n-1]);

            }

        }

    }

	return 0;

}