Problem:


Score : 300 points

Problem Statement

You are given an integer sequence of length n, a_1, ..., a_n.
Let us consider performing the following n operations on an empty sequence b.

The i-th operation is as follows:

Append a_i to the end of b.

Reverse the order of the elements in b.

Find the sequence b obtained after these n operations.

Constraints

1 \leq n \leq 2\times 10^5

0 \leq a_i \leq 10^9

n and a_i are integers.

Input

Input is given from Standard Input in the following format:

n
a_1 a_2 ... a_n

Output

Print n integers in a line with spaces in between.
The i-th integer should be b_i.

Sample Input 1

4
1 2 3 4

Sample Output 1

4 2 1 3

After step 1 of the first operation, b becomes: 1.

After step 2 of the first operation, b becomes: 1.

After step 1 of the second operation, b becomes: 1, 2.

After step 2 of the second operation, b becomes: 2, 1.

After step 1 of the third operation, b becomes: 2, 1, 3.

After step 2 of the third operation, b becomes: 3, 1, 2.

After step 1 of the fourth operation, b becomes: 3, 1, 2, 4.

After step 2 of the fourth operation, b becomes: 4, 2, 1, 3.

Thus, the answer is 4 2 1 3.

Sample Input 2

3
1 2 3

Sample Output 2

3 1 2

As shown above in Sample Output 1, b becomes 3, 1, 2 after step 2 of the third operation. Thus, the answer is 3 1 2.

Sample Input 3

1
1000000000

Sample Output 3

1000000000

Sample Input 4

6
0 6 7 6 7 0

Sample Output 4

0 6 6 0 7 7



Sample input:
4
1 2 3 4


Sample output:
4 2 1 3

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
print(*(a[n-1::-2]+(a[n-2::-2])[::-1]))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(str, input().split()))
tmp = ""
ans = ""

for i in range(n):
  tmp = tmp + a[i]
  tmp = tmp[-1::-1]

for i in range(n):
  ans = ans+tmp[i]+" "

print(ans[:-1])

Submission status: Wrong Answer

Solution code:
n = int(input())
x = list(input().split()) 
a = ''.join(x)

if n == 1:
    print(a)
    exit()

s1 = a[::2]     #奇数番目
s2 = a[1::2]    #偶数番目

s2 = s2[::-1]

s = s2 + s1

if n%2 == 1:
    s = s[::-1]

for i in s:
    print(int(i), end=' ')

Submission status: Wrong Answer

Solution code:
n = int(input())
x = list(input().split()) 
a = ''.join(x)

if n == 1:
    print(a)
    exit()

s1 = a[::2]     #奇数番目
s2 = a[1::2]    #偶数番目

s2 = s2[::-1]

s = s2 + s1

if n%2 == 1:
    s = s[::-1]

print(*s)

Submission status: Wrong Answer

Solution code:
n = int(input())
x = list(input().split()) 
a = ''.join(x)

if n == 1:
    print(a)
    exit()

s1 = a[::2]     #奇数番目
s2 = a[1::2]    #偶数番目

s = ''

if n%2 == 0:
    s = s2[::-1] + s1

else:
    s = s2 + s1
    s = s[::-1]

print(*s)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))

b = a[1::2][::-1]+a[0::2]
print(' '.join(map(str, b)))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
odd = [A[i] for i in range(0, N) if not(i & 1)]
even = [A[i] for i in range(0, N) if i & 1]
ans = []
ans.extend(reversed(even))
ans.extend(odd)
print(*ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
from _collections import defaultdict
from functools import lru_cache

class Scanner():
    def int():
        return int(sys.stdin.readline().rstrip())
    def string():
        return sys.stdin.readline().rstrip()
    def map_int():
        return [int(x) for x in Scanner.string().split()]
    def string_list(n):
        return [input() for i in range(n)]
    def int_list_list(n):
        return [Scanner.mapInt() for i in range(n)]
    def int_cols_list(n):
        return [int(input()) for i in range(n)]
        
class Math():
    def gcd(a,b):
        if b == 0:
            return a
        return Math.gcd(b,a % b)
    def lcm(a,b):
        return (a * b) // Math.gcd(a,b)
    def roundUp(a,b):
        return -(-a // b)
    def toUpperMultiple(a,x):
        return Math.roundUp(a,x) * x
    def toLowerMultiple(a,x):
        return (a // x) * x
    def nearPow2(n):
        if n <= 0:
            return 0
        if n & (n - 1) == 0:
            return n
        ret = 1
        while(n > 0):
            ret <<= 1
            n >>= 1
        return ret
    def isPrime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3,d + 1,2):
            if n % i == 0:
                return False
        return True

MOD = int(1e09) + 7

def main():
    N = Scanner.int()
    A = Scanner.map_int()
    if N == 1:
        print(A[0])
        return
    B = [0] * N
    i = 0
    j = N - 1 - N % 2
    for i in range(N // 2):
        B[i] = A[j]
        j -= 2
    i += 1
    B[i] = A[0]
    j = 2
    for i in range(i + 1,N):
        B[i] = A[j]
        j += 2
    if N % 2 == 1:
        B.reverse()
    print(B)
    return

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
from sys import stdin

N = int(stdin.readline().rstrip())
A = stdin.readline().rstrip().split()

B = A[::-1]

ans = []

if N % 2 == 0:
  for i in range(0,N,2):
    ans += [B[i]]
  for i in range(0,N,2):
    ans += [A[i]]
  
else:
  for i in range(0,N,2):
    ans += [B[i]]
  for i in range(1,N,2):
    ans += [B[i]]

print(*ans)

Submission status: Wrong Answer

Solution code:
from sys import stdin

N = int(stdin.readline().rstrip())
A = stdin.readline().rstrip().split()

B = A[::-1]

ans = ""

if N % 2 == 0:
  for i in range(0,N,2):
    ans += B[i]
  for i in range(0,N,2):
    ans += A[i]
  
else:
  for i in range(0,N,2):
    ans += B[i]
  for i in range(1,N,2):
    ans += B[i]

print(*list(ans))

Submission status: Wrong Answer

Solution code:
# N=map(int,input().split())
# t= list(map(int,input().split()))
N=3
t=[1,2,3]

b=[]
for i in range(len(t)):
    b.append(t[i])
    b=b[::-1]

print(" ".join(map(str,b)))

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
b=[]
b2=[]
if N%2==0:
  for i in range(0,N,2):
    b.append(str(a[N-i-1]))
    b2.append(str(a[i]))
  ans=b+b2
else:
  for i in range(N):
    if i%2==0:
      b.append(str(a[N-1-i]))
    else:
      b.append(str(a[i]))
  ans=b
print(' '.join(ans))

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    
    #N = int(input())
    #A = list(map(int,input().split()))
    N = 2*10**5
    A = [i for i in range(1,N+1)]
    
    from collections import deque
    que = deque()
    for i in range(N):
        if i%2==0:
            que.append(A[i])
        else:
            que.appendleft(A[i])
    #print(list(que))
    if N%2==0:
        print(*list(que))
    else:
        print(*((list(que))[::-1]))
    
main()

Submission status: Wrong Answer

Solution code:
from collections import deque

N = int(input())
A = list(map(int, input().split()))

q = deque()
for i in range(N):
  a = A[i]
  if i > 1 and i % 2 == 0:
    q.appendleft(a)
  else:
    q.append(a)

q.reverse()
print(" ".join(map(str, q)))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a1=[]
for i in range(n-1,-1,-2):
    a1.append(a[i])
a2=[]
for i in range(n-2,-1,-2):
    a2.append(a[i])
a2.reverse
a1+=a2
print(*a1)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
print(*(a[-1:0:-2]+a[::2]))

Submission status: Wrong Answer

Solution code:
n = int(input())
alist = list(map(int, input().split()))

blist = []
for i in range(n) :
    bi = alist[i]
    if i&1 == 1 :
        blist.insert(0, bi)
    else :
        blist.append(bi)

for b in blist :
    print(b, end=" ")

Submission status: Wrong Answer

Solution code:
from collections import deque

N = int(input())
*A, = map(int, input().split())
B = deque([])
for i, a in enumerate(A):
    if i % 2 == 0:
        B.append(a)
    else:
        B.appendleft(a)
print(*B)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(input().split())

b = []
for i in range(n):
    if i % 2 == 0:
        b.append(a[i])
    else:
        b.insert(0, a[i])

print(' '.join(b))

Submission status: Wrong Answer

Solution code:
from collections import deque

n = int(input())
a = [ int(x) for x in input().split() ]

q = deque([])
for key, value in enumerate(a):
    if key & 1:
        q.appendleft(value)
    else:
        q.append(value)

print(*q)

Submission status: Wrong Answer

Solution code:
n = int(input())
As= list(map(int,input().split()))
back = As[::-2]
if n%2==0:
    forward = As[::2]
else:
    forward = As[1::2]
print(back+forward)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(a) for a in input().split()]

print(*([A[i] for i in range(N-1,-1,-2)]+[A[i] for i in range(2,N,2)]))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(a) for a in input().split()]

if N%2:
  print(*([A[i] for i in range(N-1,-1,-2)]+[A[i] for i in range(2,N,2)]))
else:
  print(*([A[i] for i in range(N-1,-1,-2)]+[A[i] for i in range(0,N,2)]))

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))

print(a)
ans=list()
for i in range(1,N+1):
    if(N%2==i%2):
        ans.insert(0,a[i-1])
    else:
        ans.append(a[i-1])
for i in ans:
    print(i,end=" ")

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(str,input().split()))
s=list(reversed(a[1::2]))+a[::2]
c=""
for i in range(n):
    c+=s[i]+" "
print(c)

Submission status: Wrong Answer

Solution code:
f = lambda: list(map(int,input().split()))
n = int(input())
a = f()
if n&1:
    b = a[::-2]+a[1::2]
else:
    b = a[::-1]+a[::2]
print(*b)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[i for i in input().split()]
s=''
for i in range(N):
    s+=A[i]
    s=s[::-1]
print(' '.join(s))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a.reverse()
even_lis=[]
odd_lis=[]
for i in range(0,n,2):
    if i%2==0:
        even_lis.append(a[i])
odd_lis=list(set(a)-set(even_lis))
even_lis.extend(odd_lis)
moji=" ".join(map(str,even_lis))
print(moji)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))

b = []

for i in range(n):
    b.append(a[i])
    b = b[::-1]

print(b)

Submission status: Wrong Answer

Solution code:
def pushpush_2():
	n = int(raw_input())
	a = [e for e in raw_input().split(" ")]
	if n < 1:
		print ''
	if n == 1:
		print a[0]
	odd = a[0::2]
	even = a[1::2]
	if n % 2 == 0:
		even.reverse()
		b = even+odd
	else:
		odd.reverse()
		b = odd+even
	print ' '.join(b)

if __name__ == "__main__":
	pushpush_2()

Submission status: Wrong Answer

Solution code:
N = int(input())
s = input().split()

# b = ''
# for ss in s:
#     b += ss
#     print(b)
#     b = b[::-1]
# print(" ".join(b))

ans = []
if N % 2 == 1:
    for ss in s[::-1][0::2]:
        ans.append(ss[::-1])
    for ss in s[1::2]:
        ans.append(ss)
else:
    for ss in s[::-1][0::2]:
        ans.append(ss[::-1])
    for ss in s[0::2]:
        ans.append(ss)
print(" ".join(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())
s = input().split()

b = ''
for ss in s:
    b += ss
    b = b[::-1]
print(" ".join(b))

Submission status: Wrong Answer

Solution code:
n = input()
an = list(map(int, input().split()))
b = []

for i in an:
    b.append(i)
    b.reverse()

print(b)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int, input().split()))
k = []

for i in range(n):
  k.append(l[i])
  k = list(reversed(k))

print(",".join(map(str, k)))

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin

ns = lambda: stdin.readline()
ni = lambda: int(ns())
na = lambda: list(map(int,stdin.readline().split()))

n = ni()
a = na()

g = []
k = []
for i, x in enumerate(a):
    if (i%2==1):
        g.append(x)
    else:
        k.append(x)

g.reverse()
g.extend(k)
ret = g
ans = ""
for i, x in enumerate(ret):
    ans += str(x)
    if (i!=n-1): ans += " "
    
print (ans)

Submission status: Wrong Answer

Solution code:
n = input()
a = map(int, raw_input().split())
b = []
for i in range(n):
    if i%2 == 0:
        b.append(a[i])
    else:
        b.insert(0,a[i])
print(' '.join(map(str, b)))

Submission status: Wrong Answer

Solution code:
N=int(raw_input())
P=raw_input().split()
b=P[-1::-2]+P[-2::-2]
print " ".join(b)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=input().split()

for i in range(len(a)):
    a[i]=int(a[i])

b=[0 for i in range(len(a))]

if(n%2==0):
    for i in range(int(n/2)):
        b[i]=a[n-2*i-1]
    
    for i in range(int(n/2)):
        b[i+int(n/2)]=a[1+2*i-1]
else:
    for i in range(int((n+1)/2)):
        b[i]=a[n-2*i-1]
    for i in range(int((n-1)/2)):
        b[i+int((n+1)/2)]=a[2+2*i-1]
        
print(b)

Submission status: Wrong Answer

Solution code:
input()
n=[x for x in input().split()]
nb=n[::-1]
bs=n[::2]
if len(nb)%2==0:
    be=nb[::2]
else:
    be=nb[::2]
if len(n)==1:
    print(n[0])
else:
    print(" ".join(be+bs))

Submission status: Wrong Answer

Solution code:
n = int(input())
xs = [int(i) for i in input().split()]
if n == 1:
    print(xs[0])
else:
    output1 = [None] * (n // 2)
    output2 = [None] * (n // 2)
    suf = 1
    if n % 2 == 1:
        suf = 2
    for i in range(n // 2):
        output1[i] = xs[i*2]
        if -(-2 * i - suf) <= n:
            output2[i] = xs[-2 * i - suf]
    if n % 2 == 1:
        output1.append(xs[n // 2 + 1])
        output1.reverse()
        output2.reverse()
        print(" ".join([str(i) for i in (output1 + output2)]))
    else:
        print(" ".join([str(i) for i in (output2 + output1)]))

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[int(i) for i in input().split()]

ans=[]
if n%2:
    for i in range(n-1,n//2-1,-1):
        ans.append(l[i])
        tmp=i-n//2-1
        if tmp>=0:
            ans.append(l[tmp])
else:
    for i in range(n-1,0,-1):
        if i%2:
            ans.append(l[i])
    for i in range(n-1):
        if i%2==0:
            ans.append(l[i])

print(*ans)

Submission status: Wrong Answer

Solution code:
import sys


# sys.stdin = open('c1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_int():
    return int(input())


def read_str_list():
    return input().split()


def read_str():
    return input()


def solve():
    n = read_int()
    a = read_int_list()
    b = [0] * n
    p = 0
    q = n - 1
    for i in range(n):
        if i % 2 == (n - 1) % 2:
            b[p] = a[i]
            p += 1
        else:
            b[q] = a[i]
            q += -1
    return ' '.join(map(str, b))


def main():
    res = solve()
    print(res)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[int(i) for i in input().split()]

ans=[]
if n%2:
    for i in range(n-1,n//2-1,-1):
        ans.append(l[i])
        tmp=i-n//2-1
        if tmp>=0:
            ans.append(l[tmp])
else:
    ans.append(l.pop())
    for i in range(n-1):
        if i%2:
            ans.append(l[i])
    for i in range(n-1):
        if i%2==0:
            ans.append(l[i])

print(*ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
As = list(map(int, input().split()))
ret = []
for a in range(n-1, 0-1, -2):
    ret.append(As[a])
for a in range(0, n-1, 2):
    ret.append(As[a])
print(' '.join(map(str,ret)))

Submission status: Wrong Answer

Solution code:
from collections import deque


n = int(input())
a = list(map(int, input().split()))
b = deque()
for i in range(n):
    if i % 2:
        b.appendleft(a[i])
    else:
        b. append(a[i])
print(' '.join(map(str, b)))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a = list(map(int,input().split()))
ans = [a[0]]
for i,j in enumerate(a[1:]):
    if(N%2==0):
        if(i%2==0):
            ans.insert(0,j)
        else:
            ans.append(j)
    else:
        if(i%2==1):
            ans.insert(0,j)
        else:
            ans.append(j)
print(" ".join(map(str,ans)))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))

b = []

for i in range(n):
    b.append(a[i])
    b = b[::-1]

print(' '.join(map(str, b)))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = [A[0]]
for i in range(1, N):
    if not(i & 1):
        ans.append(A[i])
    else:
        ans.insert(0, A[i])
if N & 1:
    print(*reversed(ans))
else:
    print(*ans)

Submission status: Time Limit Exceeded

Solution code:
N=map(int,input().split())
t= list(map(int,input().split()))
# N=3
# t=[1,2,3]

b=[]
for i in range(len(t)):
    b.append(t[i])
    b=b[::-1]

print(" ".join(map(str,b)))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())

A=list(map(int,input().split()))
B=[]

for i in range(N):
    if(N%2==0):
        if(i%2==0):
            B.append(A[i])
        else:
            B.insert(0,A[i])
    else:
        if(i%2==0):
            B.insert(0,A[i])
        else:
            B.append(A[i])

for i in range(N):
    print(B[i] if i==0 else " "+str(B[i]),end="")
print()

Submission status: Time Limit Exceeded

Solution code:
N=int(input())

A=list(map(int,input().split()))
B=[]

for i in range(N):
    B.append(A[i])
    B.reverse()

for i in range(N):
    print(B[i] if i==0 else " "+str(B[i]),end="")
print()

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
a=input().split()

r=[]

for it in a:
    r.append(it)
    r=r[::-1]
print(" ".join(r))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
*a, = map(int, input().split())

b = []
for i in range(n):
    b.append(a[i])
    b.reverse()

print(" ".join(map(str, b)))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
ans=[]
for i in a:
    ans.append(i)
    ans=ans[::-1]
print(*ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(input().split())

l = []
r = []
if N % 2 == 0:
    for i, a in enumerate(A):
        if i % 2 == 1:
            l.append(a)
        else:
            r.append(a)
        l.reverse()
else:
    for i, a in enumerate(A):
        if i % 2 == 0:
            l.append(a)
        else:
            r.append(a)
        l.reverse()

ans = l + r
print(" ".join(ans))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
alist = list(map(int, input().split()))

blist = []
for i in range(n) :
    bi = alist.pop(0)
    if (n^i)&1 == 1 :
        blist.insert(0, bi)
    else :
        blist.append(bi)

for b in blist :
    print(b, end=" ")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
alist = list(map(int, input().split()))

b = []
for i in range(n) :
    ai = alist[i]
    b.append(ai)
    b.reverse()

for bi in b :
    print(bi, end=" ")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
line = input().split()
str_ = []
flag = 0 if (N % 2 != 0) else 1
for index, s in enumerate(line):
    if (flag):
        str_ += [s]
    else:
        str_ = [s] + str_
    flag ^= 1
print(' '.join(str_))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(input().split())

b = []
for i in range(n):
    if i % 2 == 0:
        b.append(a[i])
    else:
        b.insert(0, a[i])
if n % 2 == 1:
    b.reverse()

print(' '.join(b))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
A = list(map(int,input().split()))

b = []
for a in A:
    b.append(a)
    b.reverse()

print(*b)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split(' ')))
B=[]
for i in range(N):
  if i%2==0:
    B.append(A[i])
  else:
    B = [A[i]] + B
#revert B when N%2==1
print(' '.join([str(b) for b in B])) if N%2==0 else print(' '.join([str(b) for b in B[::-1]]))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = [int(a) for a in input().split()]

ans = []
for i in range(N):
  if i%2 == (N-1)%2:
    ans = [A[i]] + ans
  else:
    ans = ans + [A[i]]
print(*ans)

Submission status: Time Limit Exceeded

Solution code:
n = input()
a = map(int, raw_input().split())

res = []
for i in range(n):
  if i % 2 == 0:
    res = [a[i]] + res
  else:
    res = res + [a[i]]
if n % 2 == 0:
  print ' '.join(map(str, res[::-1]))
else:
  print ' '.join(map(str, res))

Submission status: Time Limit Exceeded

Solution code:
n = input()
a = map(int, raw_input().split())

res = []
for i in range(n):
  res += [a[i]]
  res.reverse()
print ' '.join(map(str, res))

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 10 10:05:08 2019

@author: shinjisu
"""


# ARC 077 C
def getInt(): return int(input())


def getIntList(): return [int(x) for x in input().split()]


def dmp(x):
    global debug
    if debug:
        print(x)


def probC_TLE():
    N = getInt()
    A = getIntList()
    dmp((N, A))
    b = []
    for i in range(N):
        b.append(A[i])
        b.reverse()
        dmp(b)
    return b


def probC_TLE2():
    N = getInt()
    A = getIntList()
    dmp((N, A))
    former, latter = [], []
    for i in range(-1, -N-1, -1):
        if i % 2 == 0:
            latter = [A[i]] + latter
        else:
            former.append(A[i])
        full = former + latter
        dmp((former, latter, full))
    return full


def probC():
    N = getInt()
    A = [x for x in input().split()]
    dmp((N, A))
    former, latter = '', ''
    for i in range(-1, -N-1, -1):
        if i % 2 == 0:
            latter = A[i] + ' ' + latter
        else:
            former = former + ' ' + A[i]
        dmp((former, latter))
    return former[1:] + ' ' + latter


debug = False
print(probC())
# for n in probC():
#    print(n, end=' ', flush=True)

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 10 10:05:08 2019

@author: shinjisu
"""


# ARC 077 C
def getInt(): return int(input())


def getIntList(): return [int(x) for x in input().split()]


def dmp(x):
    global debug
    if debug:
        print(x)


def probC_TLE():
    N = getInt()
    A = getIntList()
    dmp((N, A))
    b = []
    for i in range(N):
        b.append(A[i])
        b.reverse()
        dmp(b)
    return b


def probC():
    N = getInt()
    A = getIntList()
    dmp((N, A))
    former, latter = [], []
    for i in range(-1, -N-1, -1):
        if i % 2 == 0:
            latter = [A[i]] + latter
        else:
            former.append(A[i])
        full = former + latter
        dmp((former, latter, full))
    return full


debug = False
for n in probC():
    print(n, end=' ', flush=True)

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 10 10:05:08 2019

@author: shinjisu
"""


# ARC 077 C
def getInt(): return int(input())


def getIntList(): return [int(x) for x in input().split()]


def dmp(x):
    global debug
    if debug:
        print(x)


def probC():
    N = getInt()
    A = getIntList()
    dmp((N, A))
    b = []
    for i in range(N):
        b.append(A[i])
        b.reverse()
        dmp(b)
    return b


debug = False
for n in probC():
    print(n, end=' ', flush=True)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))

ans = [A[0]]
for i in range(1, N):
    if i % 2 == 0:
        ans.append(A[i])
    else:
        ans.insert(0, A[i])

if N % 2 == 1:
    ans = ans[::-1]

print(" ".join(list(map(str, ans))))

Submission status: Time Limit Exceeded

Solution code:
n=int(input().strip())
a=list(map(int, input().split()))
b=[]
for i in range(n):
    b.append(a[i])
    b=b[::-1]
print(' '.join(map(str, b)))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=[i for i in input().split()]
s=A[0]
if N%2==1:
    for i in range(1,N):
        if i%2==1:
            s=s+' '+A[i]
        else:
            s=A[i]+' ' +s
else:
    for i in range(1,N):
        if i%2==0:
            s=s+' '+A[i]
        else:
            s=s=A[i]+' ' +s
print(s)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=[i for i in input().split()]
s=[A[0]]
if N%2==1:
    for i in range(1,N):
        if i%2==1:
            s=s+[A[i]]
        else:
            s=[A[i]]+s
else:
    for i in range(1,N):
        if i%2==0:
            s=s+[A[i]]
        else:
            s=[A[i]]+s 
print(' '.join(map(str,s)))

Submission status: Time Limit Exceeded

Solution code:
# cook your dish here
n = int(input())
a = list(map(int,input().split()))
b = []

for i in range(n):
    if i % 2 == 0:
        b.insert(0,a[i])
    else:
        b.append(a[i])
c = b[::-1]
ass = ''
for i in range(n):
    if n %2 == 0:
        ass += str(c[i]) + ' '
    else:
        ass += str(b[i]) + ' '
print(ass)

Submission status: Time Limit Exceeded

Solution code:
# cook your dish here
n = int(input())
a = list(map(int,input().split()))
b = []

for i in range(n):
    if i % 2 == 0:
        b = [a[i]]+b
    else:
        b.append(a[i])
c = b[::-1]
ass = ''
for i in range(n):
    if n %2 == 0:
        ass += str(c[i]) + ' '
    else:
        ass += str(b[i]) + ' '
print(ass)

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
a = input().split()
b = []

for i in range(n):
    if i%2==0:
        b.append(a[i])
    else:
        b.insert(0, a[i])

if n%2==0:
    print(" ".join(b))
else:
    print(" ".join(b[::-1]))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split()))
if n % 2 == 1:
    b = []
    for i in range(n//2):
        b = [a[2*i]]+b
        b.append(a[2*i+1])
    b = [a[-1]]+b
    print(' '.join(map(str,b)))
else:
    b = []
    for i in range(n//2):
        b.append(a[2*i])
        b = [a[2*i+1]]+b
    print(' '.join(map(str,b)))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split()))

b = []

for i in a:
    b.append(i)
    b.reverse()
print(' '.join(map(str,b)))

Submission status: Time Limit Exceeded

Solution code:
import math
import sys

def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result





arr_data = getinputdata()

n = int(arr_data[0][0])
arr = arr_data[1]


#list01=list(map(int, arr))


#print(n,list01)

b=[]

for i in range(0,n):
    
#    print(i)
    
    b.append(arr[i])
    
    b.reverse()
    
print(" ".join(b))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
if n == 1:
    print(input())
else:
    a = input().split()
    b = ''
    for i in range(n):
        b += a[i]
        b = b[::-1]
    for i in range(n - 1):
        print(b[i], end = ' ')
    print(b[n - 1])

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
b = []
for i in range(n):
    if i  % 2 == 0: b.append(a[i])
    else: b = [a[i]] + b
if i % 2 == 0: b.reverse()
print(*b)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
b = []
for i in range(n):
    b.append(a[i])
    b.reverse()
print(*b)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))

ans = []
if (N % 2) == 1:
    ans.append(A[0])
    for i in range(1, len(A), 2):
        ans.append(A[i])
        ans.insert(0, A[i + 1])
else:
    for i in range(0, len(A), 2):
        ans.append(A[i])
        ans.insert(0, A[i + 1])


for i in ans:
    print(i, end=" ")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))

b = []

for i in range(n):
    if i % 2 != n % 2:
        b.insert(0, a[i])
    else:
        b.append(a[i])

print(" ".join(map(str, b)))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))

b = []

for i in range(n):
    if i % 2 != n % 2:
        b.insert(0, a[i])
    else:
        b.append(a[i])

for i in range(n):
    print(b[i], end=" ")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))

b = []

for i in range(n):
    b.append(a[i])
    b = b[::-1]

for i in range(n):
    print(b[i], end = " ")

Submission status: Time Limit Exceeded

Solution code:
def pushpush():
	n = int(raw_input())
	a = [e for e in raw_input().split(" ")]
	if n < 1:
		print ''
	b = []
	for i in range(n):
		# append the ith to b
		b.append(a[i])
		# reverse b
		b.reverse()
	print ' '.join(b)

if __name__ == "__main__":
	pushpush()

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
A = input().split()
b = []
for (i, a) in enumerate(A):
    if i % 2 == 0:
        b.append(a)
    else:
        b.insert(0, a)
if n % 2 == 1:
    b = list(reversed(b))
print(' '.join(b))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
an = list(input().split())
b = []

cnt = 1
for i in an:
    if cnt % 2 == 0 :
        b.insert(0, i)
    else:
        b.append(i)
    cnt += 1

if n % 2 == 1:
    b.reverse()

print(' '.join(b))

Submission status: Time Limit Exceeded

Solution code:
n = input()
an = list(map(int, input().split()))
b = []

for i in an:
    b.append(i)
    b.reverse()

print(' '.join(map(str, b)))

Submission status: Time Limit Exceeded

Solution code:
def main():
    n = int(input())
    a = list(map(int, input().split()))
    b = []
    if n % 2 == 1:
        for i in range(n):
            if i % 2 == 0:
                b.insert(0, a[i])
            else:
                b.append(a[i])
    else:
        for i in range(n):
            if i % 2 == 0:
                b.append(a[i])
            else:
                b.insert(0, a[i])
    print(' '.join(list(map(str, b))))
                
main()

Submission status: Time Limit Exceeded

Solution code:
def main():
    n = int(input())
    a = list(map(int, input().split()))
    b = []
    for i in range(n):
        b.append(a[i])
        b.reverse()
    print(' '.join(list(map(str, b))))
main()

Submission status: Time Limit Exceeded

Solution code:
import sys

stdin = sys.stdin

ns = lambda: stdin.readline()
ni = lambda: int(ns())
na = lambda: list(map(int,stdin.readline().split()))

n = ni()
a = na()

ret = []
for i, x in enumerate(a):
    ret.append(x)
    ret.reverse()

ans = ""
for i, x in enumerate(ret):
    ans += str(x)
    if (i!=n-1): ans += " "
    
print (ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

values = input().split(" ")

results = []
for i,value in enumerate(values):
  if i % 2 == 0:
    results.append(value)
  else:
    results.insert(0, value)

if len(values) % 2 == 1:
  results.reverse()
print(" ".join(results))

Submission status: Time Limit Exceeded

Solution code:


n = int(raw_input())
a = map(int,raw_input().split())

string = ""

for i in range(n):
    if i==0:
        string = str(a[i])
    else:
        if (i+n)%2==0:  
            string += " " + str(a[i])
        else:
            string = str(a[i]) + " " + string
        
print string