stablegradients/pie-gem5-pairs huggingface dataset:
// 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.209478663305087x):
#include<stdio.h>

#include<algorithm>

using namespace std;

int n,a[200010]={0},b[200010]={0};

int main()

{

    int t=0;

    scanf("%d",&n);

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

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

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

    {

        if(i%2==0)

            b[t]=a[n-1-i];

        else

        {

            b[n-t-1]=a[n-1-i];

            t++;

        }

    }

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

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

    printf("\n");

    return 0;

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

#include <bitset>

#include <cassert>

#include <cctype>

#include <cmath>

#include <complex>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <ctime>

#include <deque>

#include <fstream>

#include <functional>

#include <iomanip>

#include <iostream>

#include <list>

#include <map>

#include <numeric>

#include <queue>

#include <set>

#include <sstream>

#include <stack>

#include <string>

#include <utility>

#include <vector>

#define LL long long

#define pb push_back

#define pob pop_back

#define mp make_pair

#define FILL(a,v) memset((void*)a,v,sizeof(a))

#define FILL0(a) FILL(a,0)

#define FILL1(a) FILL(a,-1)

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

#define Inf 1e9

#define Mod 1000000007

#define foreach(it,x) for(typeof(x.begin()) it=x.begin();it!=x.end();it++)

#define FOR(i,x) for(int i=0;i<x;i++)

#define RFOR(i,x) for(int i=x-1;i>=0;i--)

#define FFOR(i,a,b) for(int i=a;i<b;i++)

#define FRFOR(i,a,b) for(int i=a-1;i>=b;i--)

#define SZ(a) ((int)(a).size())

#define FI first

#define SE second

#define OVER(a) return puts(a),0

using namespace std;

using namespace __gnu_cxx;

typedef pair<int,int> pii;

typedef unsigned long long UINT;

typedef unsigned int Uint;

typedef long long INT;

typedef pair<INT,INT> PII;



int n,a[200007];

vector<int> b,c;



int main()

{

	scanf("%d",&n);

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

	{

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

		if((n-i)%2==0) c.push_back(a[i]);

		else b.push_back(a[i]);

	}

	for(int i=SZ(b)-1;i>=0;i--)

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

	for(int i=0;i<SZ(c);i++)

		printf("%d%c",c[i],i==SZ(c)-1?'\n':' ');

	return 0;

}


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

#include<algorithm>

using namespace std;

int n,a[200010]={0},b[200010]={0};

int main()

{

    int t=0;

    scanf("%d",&n);

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

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

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

    {

        if(i%2==0)

            b[t]=a[n-1-i];

        else

        {

            b[n-t-1]=a[n-1-i];

            t++;

        }

    }

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

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

    printf("\n");

    return 0;

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

#include<cstring>

int a[200005];

int b[200005];



int main(){

	int n;

	while(scanf("%d",&n)==1){

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

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

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

		}

		if(n%2==0){

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

				b[j]=a[i];

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

				b[j]=a[i];

		}

		else{

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

				b[j]=a[i];

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

				b[j]=a[i];

		}

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

			if(i<n-1) printf("%d ",b[i]);

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

		}

	}

	return 0;

}

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

#include<algorithm>

using namespace std;

int n,a[200010]={0},b[200010]={0};

int main()

{

    int t=0;

    scanf("%d",&n);

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

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

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

    {

        if(i%2==0)

            b[t]=a[n-1-i];

        else

        {

            b[n-t-1]=a[n-1-i];

            t++;

        }

    }

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

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

    printf("\n");

    return 0;

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

#include<math.h>

#include<string>

#include<cstring>

#include<iostream>

#include<iomanip>

#include<queue>

#include<stack>

#include<map>

#include<cmath>

#include<fstream>  // 文件读取  ifstream ofstream

#include<algorithm>  

#include<vector>

using namespace std;





int n;



struct List{

	int node;

	List *next;

};



int main()  

{  





	cin>>n;

	List *L;

	L = new List;

	List *end = new List;

	end = L;

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

		int temp;

		cin>>temp;

		List *t = new List;

		t->node = temp;

		if(i%2==0){

			end->next = t;

			end = end->next;

		}else{

			t->next = L->next;

			L->next  = t;

		}

	}



	vector<int>sq;



	L=L->next;

	int index = 0;

	while(index<n){

		sq.push_back(L->node);

		L=L->next;

		index++;

	}



	if(n%2==0){

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

			cout<<sq[i]<<" ";

	}else{

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

			cout<<sq[i]<<" ";

	}





	return 0;





} 






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

#include<algorithm>

using namespace std;

int n,a[200010]={0},b[200010]={0};

int main()

{

    int t=0;

    scanf("%d",&n);

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

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

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

    {

        if(i%2==0)

            b[t]=a[n-1-i];

        else

        {

            b[n-t-1]=a[n-1-i];

            t++;

        }

    }

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

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

    printf("\n");

    return 0;

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

#include<list>

using namespace std;

int A[200005];

list<int>::iterator it;

list<int>::reverse_iterator iq;

int main()

{

int n;

cin >> n;

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

{

	cin >> A[i];

}

list<int> c(1,A[0]);



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

{

 if(i%2==0) c.push_back(A[i-1]);

 else c.push_front(A[i-1]);	

}



if(n%2!=0) {

	for(it=c.begin();it!=c.end();it++)

	{

		cout << *it<<" ";

	}

}

else {

for(iq=c.rbegin();iq!=c.rend();iq++)

{

	cout << *iq<<" ";

}

}

return 0;	

}

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

#include<algorithm>

using namespace std;

int n,a[200010]={0},b[200010]={0};

int main()

{

    int t=0;

    scanf("%d",&n);

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

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

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

    {

        if(i%2==0)

            b[t]=a[n-1-i];

        else

        {

            b[n-t-1]=a[n-1-i];

            t++;

        }

    }

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

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

    printf("\n");

    return 0;

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

#include<list>

using namespace std;

int A[200005];

list<int>::iterator it;

list<int>::reverse_iterator iq;



int main(){

	int n;

	cin >> n;

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

    	cin >> A[i];

	}

	list<int> c(1,A[0]);

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

		if(i%2==0) c.push_back(A[i-1]);

		else c.push_front(A[i-1]);	

	} 

	if(n%2!=0) {

	   for(it=c.begin();it!=c.end();it++){

			cout << *it<<" ";

		}

	}

	else {

		for(iq=c.rbegin();iq!=c.rend();iq++){

		cout << *iq<<" ";

		}

	}

	return 0;	

}

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

#include<algorithm>

using namespace std;

int n,a[200010]={0},b[200010]={0};

int main()

{

    int t=0;

    scanf("%d",&n);

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

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

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

    {

        if(i%2==0)

            b[t]=a[n-1-i];

        else

        {

            b[n-t-1]=a[n-1-i];

            t++;

        }

    }

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

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

    printf("\n");

    return 0;

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

using namespace std;

typedef long long ll;

const int MAXSIZE=10000020;

int bufpos;

char buf[MAXSIZE];

#define NEG 0

void init(){

	#ifdef LOCAL

		freopen("F.txt","r",stdin);

	#endif

	buf[fread(buf,1,MAXSIZE,stdin)]='\0';

	bufpos=0;

}

#if NEG

int readint(){

	bool isneg;

	int val=0;

	for(;!isdigit(buf[bufpos]) && buf[bufpos]!='-';bufpos++);

	bufpos+=(isneg=buf[bufpos]=='-');

	for(;isdigit(buf[bufpos]);bufpos++)

		val=val*10+buf[bufpos]-'0';

	return isneg?-val:val;

}

#else

int readint(){

	int val=0;

	for(;!isdigit(buf[bufpos]);bufpos++);

	for(;isdigit(buf[bufpos]);bufpos++)

		val=val*10+buf[bufpos]-'0';

	return val;

}

#endif

char readchar(){

	for(;isspace(buf[bufpos]);bufpos++);

	return buf[bufpos++];

}

int readstr(char* s){

	int cur=0;

	for(;isspace(buf[bufpos]);bufpos++);

	for(;!isspace(buf[bufpos]);bufpos++)

		s[cur++]=buf[bufpos];

	s[cur]='\0';

	return cur;

}

int b[200002];

int main(){

	init();

	int n=readint();

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

		b[i]=readint();

	if (n%2){

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

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

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

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

	}else{

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

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

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

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

	}

}

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

#include<algorithm>

using namespace std;

int n,a[200010]={0},b[200010]={0};

int main()

{

    int t=0;

    scanf("%d",&n);

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

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

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

    {

        if(i%2==0)

            b[t]=a[n-1-i];

        else

        {

            b[n-t-1]=a[n-1-i];

            t++;

        }

    }

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

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

    printf("\n");

    return 0;

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

#include<iostream>

#include<string.h>

#include<algorithm>

#include<map>

#include<vector>

#include<string>

#define ll long long

#define For(i,x,y)  for(ll i=x;i<=y;++i)

#define FOr(i,x,y)  for(ll i=x;i>=y;--i)

using namespace std;

inline ll read(){   ll x=0,f=1;char ch=getchar();   while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}  while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}  return x*f; } 

inline void write(ll x){    if (x<0) putchar('-'),x=-x; if (x>=10) write(x/10);   putchar(x%10+'0');  } 

inline void writeln(ll x){ write(x);   puts("");   }

const ll N=400010;

ll n,a[N],b[N];

int main(){

	n=read();

	For(i,1,n)	a[i]=read();

	ll l=1,r=n,rev=1;

	FOr(i,n,1){

		if (rev)	b[l++]=a[i];

		else	b[r--]=a[i];

		rev^=1;

	}

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

}

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

#include<algorithm>

using namespace std;

int n,a[200010]={0},b[200010]={0};

int main()

{

    int t=0;

    scanf("%d",&n);

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

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

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

    {

        if(i%2==0)

            b[t]=a[n-1-i];

        else

        {

            b[n-t-1]=a[n-1-i];

            t++;

        }

    }

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

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

    printf("\n");

    return 0;

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

using namespace std;



int main() {



	int length;

	cin >> length;

	int *a = new int[length];

	int *b = new int[length];

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

		cin >> a[i];

	}



	int left = 0, right = length - 1;

	if (length % 2 == 0) {

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

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

			b[right--] = a[i - 1];

		}

	}

	else {

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

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

			b[right--] = a[i - 1];

		}

		b[length / 2] = a[0];

	}





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

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

	}

}






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

#include<algorithm>

using namespace std;

int n,a[200010]={0},b[200010]={0};

int main()

{

    int t=0;

    scanf("%d",&n);

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

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

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

    {

        if(i%2==0)

            b[t]=a[n-1-i];

        else

        {

            b[n-t-1]=a[n-1-i];

            t++;

        }

    }

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

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

    printf("\n");

    return 0;

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

using namespace std;



int main() {

	int a[200001];

	int n;

	cin >> n;

	if (n){

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

	        cin >>a[i];

	   }

	    if (n==1){

	        cout<<a[1];

	        return 0;

	    }

	    if (n%2){

	       

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

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

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

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

                cout<<a[n-1];

                cout<<endl;

	    }

	    else{

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

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

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

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

               cout<<a[n-1];

           cout<<endl;

	    }

	}

	return 0;

}

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

#include<algorithm>

using namespace std;

int n,a[200010]={0},b[200010]={0};

int main()

{

    int t=0;

    scanf("%d",&n);

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

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

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

    {

        if(i%2==0)

            b[t]=a[n-1-i];

        else

        {

            b[n-t-1]=a[n-1-i];

            t++;

        }

    }

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

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

    printf("\n");

    return 0;

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

using namespace std;

int a[200050];

int main() {

	

	int n,i;

	cin >> n;

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

		cin >> a[i];

	}

	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: 5.216906529402152x):
#include<stdio.h>

#include<algorithm>

using namespace std;

int n,a[200010]={0},b[200010]={0};

int main()

{

    int t=0;

    scanf("%d",&n);

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

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

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

    {

        if(i%2==0)

            b[t]=a[n-1-i];

        else

        {

            b[n-t-1]=a[n-1-i];

            t++;

        }

    }

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

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

    printf("\n");

    return 0;

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

#include<stdio.h>

using namespace std;

int a[200050], b[200050];

int main()

{

	int n;

	scanf("%d", &n);

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

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

	b[n / 2 + 1] = a[1];

	if (n % 2)

	{

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

		{

			b[n / 2 + 1 + i] = a[2 * i];

			b[n / 2 + 1 - i] = a[2 * i + 1];

		}

	}

	else

	{

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

		{

			b[n / 2 + 1 - i] = a[2 * i];

		}

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

		{

			b[n / 2 + 1 + i] = a[2 * i + 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: 5.20102802483834x):
#include<stdio.h>

#include<algorithm>

using namespace std;

int n,a[200010]={0},b[200010]={0};

int main()

{

    int t=0;

    scanf("%d",&n);

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

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

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

    {

        if(i%2==0)

            b[t]=a[n-1-i];

        else

        {

            b[n-t-1]=a[n-1-i];

            t++;

        }

    }

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

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

    printf("\n");

    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.195092319108382x):
#include<stdio.h>

#include<stdlib.h>

#pragma warning(disable:4996)

int main()

{

	int a;

	scanf("%d", &a);

	long long *b = (long long *)malloc(sizeof(long long)*a);

	long long *c = (long long *)malloc(sizeof(long long)*a);

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

	{

		scanf("%lld", b + i);

	}

	int A = a;

	if (a % 2 == 0)

	{

		for (int i = 0; i < A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 0; i < A/2; i++)

		{

			c[i+A/2] = b[2 * i];

		}

	}

	if (a % 2 == 1)

	{

		for (int i = 0; i <= A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 1; i <= A / 2; i++)

		{

			c[A / 2+i] = b[2 * i-1];

		}

	}

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

	{

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

	}

	getchar();

	getchar();

	return 0;

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

#include <bitset>

#include <cassert>

#include <cctype>

#include <cmath>

#include <complex>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <ctime>

#include <deque>

#include <fstream>

#include <functional>

#include <iomanip>

#include <iostream>

#include <list>

#include <map>

#include <numeric>

#include <queue>

#include <set>

#include <sstream>

#include <stack>

#include <string>

#include <utility>

#include <vector>

#define LL long long

#define pb push_back

#define pob pop_back

#define mp make_pair

#define FILL(a,v) memset((void*)a,v,sizeof(a))

#define FILL0(a) FILL(a,0)

#define FILL1(a) FILL(a,-1)

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

#define Inf 1e9

#define Mod 1000000007

#define foreach(it,x) for(typeof(x.begin()) it=x.begin();it!=x.end();it++)

#define FOR(i,x) for(int i=0;i<x;i++)

#define RFOR(i,x) for(int i=x-1;i>=0;i--)

#define FFOR(i,a,b) for(int i=a;i<b;i++)

#define FRFOR(i,a,b) for(int i=a-1;i>=b;i--)

#define SZ(a) ((int)(a).size())

#define FI first

#define SE second

#define OVER(a) return puts(a),0

using namespace std;

using namespace __gnu_cxx;

typedef pair<int,int> pii;

typedef unsigned long long UINT;

typedef unsigned int Uint;

typedef long long INT;

typedef pair<INT,INT> PII;



int n,a[200007];

vector<int> b,c;



int main()

{

	scanf("%d",&n);

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

	{

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

		if((n-i)%2==0) c.push_back(a[i]);

		else b.push_back(a[i]);

	}

	for(int i=SZ(b)-1;i>=0;i--)

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

	for(int i=0;i<SZ(c);i++)

		printf("%d%c",c[i],i==SZ(c)-1?'\n':' ');

	return 0;

}


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

#include<stdlib.h>

#pragma warning(disable:4996)

int main()

{

	int a;

	scanf("%d", &a);

	long long *b = (long long *)malloc(sizeof(long long)*a);

	long long *c = (long long *)malloc(sizeof(long long)*a);

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

	{

		scanf("%lld", b + i);

	}

	int A = a;

	if (a % 2 == 0)

	{

		for (int i = 0; i < A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 0; i < A/2; i++)

		{

			c[i+A/2] = b[2 * i];

		}

	}

	if (a % 2 == 1)

	{

		for (int i = 0; i <= A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 1; i <= A / 2; i++)

		{

			c[A / 2+i] = b[2 * i-1];

		}

	}

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

	{

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

	}

	getchar();

	getchar();

	return 0;

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

#include<cstring>

int a[200005];

int b[200005];



int main(){

	int n;

	while(scanf("%d",&n)==1){

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

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

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

		}

		if(n%2==0){

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

				b[j]=a[i];

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

				b[j]=a[i];

		}

		else{

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

				b[j]=a[i];

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

				b[j]=a[i];

		}

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

			if(i<n-1) printf("%d ",b[i]);

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

		}

	}

	return 0;

}

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

#include<stdlib.h>

#pragma warning(disable:4996)

int main()

{

	int a;

	scanf("%d", &a);

	long long *b = (long long *)malloc(sizeof(long long)*a);

	long long *c = (long long *)malloc(sizeof(long long)*a);

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

	{

		scanf("%lld", b + i);

	}

	int A = a;

	if (a % 2 == 0)

	{

		for (int i = 0; i < A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 0; i < A/2; i++)

		{

			c[i+A/2] = b[2 * i];

		}

	}

	if (a % 2 == 1)

	{

		for (int i = 0; i <= A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 1; i <= A / 2; i++)

		{

			c[A / 2+i] = b[2 * i-1];

		}

	}

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

	{

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

	}

	getchar();

	getchar();

	return 0;

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

#include<math.h>

#include<string>

#include<cstring>

#include<iostream>

#include<iomanip>

#include<queue>

#include<stack>

#include<map>

#include<cmath>

#include<fstream>  // 文件读取  ifstream ofstream

#include<algorithm>  

#include<vector>

using namespace std;





int n;



struct List{

	int node;

	List *next;

};



int main()  

{  





	cin>>n;

	List *L;

	L = new List;

	List *end = new List;

	end = L;

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

		int temp;

		cin>>temp;

		List *t = new List;

		t->node = temp;

		if(i%2==0){

			end->next = t;

			end = end->next;

		}else{

			t->next = L->next;

			L->next  = t;

		}

	}



	vector<int>sq;



	L=L->next;

	int index = 0;

	while(index<n){

		sq.push_back(L->node);

		L=L->next;

		index++;

	}



	if(n%2==0){

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

			cout<<sq[i]<<" ";

	}else{

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

			cout<<sq[i]<<" ";

	}





	return 0;





} 






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

#include<stdlib.h>

#pragma warning(disable:4996)

int main()

{

	int a;

	scanf("%d", &a);

	long long *b = (long long *)malloc(sizeof(long long)*a);

	long long *c = (long long *)malloc(sizeof(long long)*a);

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

	{

		scanf("%lld", b + i);

	}

	int A = a;

	if (a % 2 == 0)

	{

		for (int i = 0; i < A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 0; i < A/2; i++)

		{

			c[i+A/2] = b[2 * i];

		}

	}

	if (a % 2 == 1)

	{

		for (int i = 0; i <= A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 1; i <= A / 2; i++)

		{

			c[A / 2+i] = b[2 * i-1];

		}

	}

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

	{

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

	}

	getchar();

	getchar();

	return 0;

}