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: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
l = [a[0]]
for i in range(n-1):
    l.append(a[i+1])
    l.reverse()
for i in range(n):
    print(l[i], end="")
    if i != n-1:
        print(" ", end="")
print("")

Submission status: Time Limit Exceeded

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

index=0
while index < n:
    a = listA[index]
    if index%2==0:
        listC=[a]
        listC.extend(listB)
        listB=listC
    else:
        listB.append(a)
    index+=1
if n%2==0:
    listB.reverse()

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

Submission status: Time Limit Exceeded

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

index=0
while index < n:
    a = listA[index]
    if index%2==0:
        listB.insert(0, a)
    else:
        listB.append(a)
    index+=1
if n%2==0:
    listB.reverse()

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

Submission status: Time Limit Exceeded

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

index=0
while index < n:
    a = listA[index]
    listB.append(a)
    listB.reverse()
    index+=1

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

Submission status: Time Limit Exceeded

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

b = []

for num in a:
    b.append(num)
    b.reverse()
print(*b)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
A = list(map(int,input().split()))
L = []
for i in range(n):
  L.append(A[i])
  L.reverse()
for j in range(n):
  print(L[j],end = ' ')

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split()))
b = []
for i in range(0,len(a)):
    if i%2 == 0:
        b.append(a[i])
    else:
        b.insert(0,a[i])
if n%2 == 0:
    for i in range(0,n):
        print(b[i],end=" ")
else:
    for i in range(n-1,-1,-1):
        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 - 1):
    print(b[i], end = " ")
print(b[n - 1], end = "")
print()

Submission status: Time Limit Exceeded

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

b_list = []

for i, a in enumerate(a_list):
    if i % 2 == 0:
        b_list.insert(0, a)
    else:
        b_list.append(a)

if n % 2 ==0:
    b_list.reverse()
print(" ".join(map(str, b_list)))

Submission status: Time Limit Exceeded

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

b_list = []

for a in a_list:
    b_list.append(a)
    b_list.reverse()

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

Submission status: Time Limit Exceeded

Solution code:
#ABC066C
n=int(input())
a=list(map(int, input().split()))
front=[]
back=[]
flg=n%2
for i in range(n//2):
    front.insert(0, a[2*i-flg+1])
    #back.append(a[2*i+flg])
back=[a[2*i+flg] for i in range(n//2)]
if flg==1:
    front.insert(0, a[n-1])
print(' '.join(map(str, front+back)))

Submission status: Time Limit Exceeded

Solution code:
#ABC066C
n=int(input())
a=list(map(int, input().split()))
front=[]
back=[]
flg=n%2
for i in range(n//2):
    front.insert(0, a[2*i-flg+1])
    back.append(a[2*i+flg])
if flg==1:
    front.insert(0, a[n-1])
print(' '.join(map(str, front+back)))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


# --------------------------------------------

dp = None


def main():
    N = int(input())
    A = li_input()

    B = []

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

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


main()

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = input().split()
b = []
for i in range(n):
  if i % 2 == 0:
    b = b + a[i:i+1]
  else:
    b = a[i:i+1] + b
if n % 2 == 1:
  b = b[::-1]
print(" ".join(b))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = input().split()
b = []
for i in range(n):
  b.append(a[i])
  b = b[::-1]
print(" ".join(b))

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:
#-*-coding:utf-8-*-

def main():
    n = int(input())
    a_list = list(map(int, input().split()))
    b = []

    for i in range(n):
        if i % 2 != 0:
            b.insert(0, a_list[i])
        else:
            b.append(a_list[i])
    if len(a_list) % 2 != 0:
        b = b[::-1]
    print(' '.join(map(str, b)))


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
q = [a[0]]
pre = 0
for i in range(1, n):
    if pre == 0:
        q.append(a[i])
        pre ^=1
    else:
        q.insert(0, a[i])
        pre ^= 1

if n % 2 == 0:
    print(" ".join(map(str, q[::-1])))
else:
    print(" ".join(map(str, q)))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-

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

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

print(" ".join(bN))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = [i for i in input().split()]
b = []
for i in range(n):
    b.insert(i%2*len(a), a[i])

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

Submission status: Time Limit Exceeded

Solution code:
input()
b=[]
for a in map(int,input().split()):
    b+=[a]
    b=b[::-1]
print(*b)

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()
print(' '.join(map(str,b)))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
index = 0
result = []
if n % 2 == 0:
    for i in input().split():
        if index % 2 == 1:
            result.insert(0, i)
            index += 1
        else:
            result.append(i)
            index += 1
else:
    for i in input().split():
        if index % 2 == 1:
            result.append(i)
            index += 1
        else:
            result.insert(0, i)
            index += 1

print(" ".join(result))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

result = []

def cal(n, result):
    result.append(i)
    result = result[::-1]
    return result

for i in input().split():
    result = cal(i, result)

print(" ".join(result))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

result = []

for i in input().split():
    result.append(i)
    result = result[::-1]

print(" ".join(result))

Submission status: Time Limit Exceeded

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

result = []

for i in inuput_list:
    result.append(str(i))
    result = result[::-1]

print(" ".join(result))

Submission status: Time Limit Exceeded

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

result = []

for i in inuput_list:
    result.append(i)
    result = result[::-1]

for i in result:
    print(str(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(str(a[i]))
    b=b[::-1]
print(' '.join(b))

Submission status: Time Limit Exceeded

Solution code:
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 = [x for x  in arr_data[1]]

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = input()
a = map(int, raw_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 = input().split()
b = []

for num in a:
    b = b + [num]
    b = b[::-1]

print(" ".join(b))

Submission status: Time Limit Exceeded

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

for i, num in enumerate(a):
  if i%2 == 0:
    b = b + [num]
  else:
    b = [num] + b
    
if n%2 != 0:
  b = b[::-1]

print(" ".join(b))

Submission status: Time Limit Exceeded

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

ans = ''
if n % 2 != 0: ans = a.pop(0)
for i in range(0, n/2):
	if ans == '': ans = a[2*i+1] + ' ' + a[2*i]
	else: ans = a[2*i+1] + ' ' + ans + ' ' + a[2*i]

print ans

Submission status: Time Limit Exceeded

Solution code:
n =int(input())
ans=[]
lis=list(map(int,input().split()))
if n %2:
  for i in range(n):
    if i%2:
      ans=ans+[lis[i]]
    else:
      ans=[lis[i]]+ans
else:
  for i in range(n):
    if not i%2:
      ans=ans+[lis[i]]
    else:
      ans=[lis[i]]+ans
print(*ans)

Submission status: Time Limit Exceeded

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

even = []
odd = []
for i in range(0, n):
	if i%2 == 0: even.append(a[i])
	else: odd.append(a[i])
ans = []
if n%2 != 0:
	even.reverse()
	even.extend(odd)
	ans = even
else:
	odd.reverse()
	odd.extend(even)
	ans = odd

s = ''
for i in range(0, n):
	s = s + ans[i] + ' '
print s[0:len(s)-1]

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ll = list(map(int,input().split()))
mm = []
pp = n
i = 0
for i in range(n):
    try:
        mm.append(str(ll[-1-2*i]))
        ll[-1-2*i] = '-1'
    except:
        pass

    
for i in range(len(ll)):
    if ll[i] != '-1':
        mm.append(str(ll[i]))
    else:
        None
        
sss = ''
for i in range(len(mm)):
    if i != 0:
        sss = sss + ' ' + mm[i]
    else:
        sss = sss + mm[i]
        
print(sss)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ll = list(map(int,input().split()))
mm = []
pp = n
i = 0
for i in range(n//2 + 1):
    try:
        mm.append(ll[-1-2*i])
        ll[-1-2*i] = -1
    except:
        pass

    
for i in range(len(ll)):
    if ll[i] > -1:
        mm.append(ll[i])
    else:
        None
        
sss = ''
for i in range(len(mm)):
    if i != 0:
        sss = sss + ' ' + str(mm[i])
    else:
        sss = sss + str(mm[i])
        
print(sss)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ll = list(map(int,input().split()))
mm = []
pp = n
i = 0
for i in range(n):
    try:
        mm.append(ll[-1-2*i])
        ll[-1-2*i] = -1
    except:
        pass

    
for i in range(len(ll)):
    if ll[i] > -1:
        mm.append(ll[i])
    else:
        None
        
sss = ''
for i in range(len(mm)):
    if i != 0:
        sss = sss + ' ' + str(mm[i])
    else:
        sss = sss + str(mm[i])
        
print(sss)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ll = list(map(int,input().split()))
mm = []
pp = n
i = 0
while pp > 0:
    mm.append(ll[-1-i])
    ll[-1-i] = -1
    i = i + 2
    pp = pp -2
    
for i in range(len(ll)):
    if ll[i] > -1:
        mm.append(ll[i])
    else:
        None
        
sss = ''
for i in range(len(mm)):
    if i != 0:
        sss = sss + ' ' + str(mm[i])
    else:
        sss = sss + str(mm[i])
        
print(sss)

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=list(reversed(b))
bstr=' '.join(str(x) for x in b)
print(bstr)

Submission status: Time Limit Exceeded

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

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 = list(reversed(b))
print(*b)

Submission status: Time Limit Exceeded

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

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()
outp=str(b[0])
for i in range(1,n):outp+=" "+str(b[i])
print(outp)

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()
map_b=map(str,b)
v=" ".join(map_b)
print(v)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a=[]
c=1

for i in input().split():
  if c % 2 ==1:
    a=a+[i]
  else:
    a=[i]+a
  c+=1
  
if c % 2 ==1:
  print(*a)
else:
  print(*a[::-1])

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a=[]
c=1
p=1
for i in input().split():
  if c % 2 ==1:
    a=a+[i]
  else:
    a=[i]+a
  c+=1
  p=p*-1
  
print(*a[::p])

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()

C = [str(i) for i in B]   
print(' '.join(C))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
l = input().split()
b = []
for w in range(n):
    b.append(l.pop(0))
    b.reverse()

print(" ".join(b))

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()))
b = []

for i in range(n):
    b.append(a[i])
    b = b[::-1]
for i in range(n-1):
    print('{0} '.format(b[i]), end='')
print(b[-1])

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
b = []
st = input().split()
for i in range(n):
    k = st[i]
    if i % 2 == 0:
        b.insert(0, k)
    else:
        b.append(k)
if n % 2 == 0:
    b= list(reversed(b))
s = ""
for k in b:
    s += k + " "
print(s)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
b = []
st = input().split()
for i in range(n):
    k = int(st[i])
    if i % 2 == 0:
        b.insert(0, k)
    else:
        b.append(k)
if n % 2 == 0:
    b= list(reversed(b))
s = ""
for k in b:
    s += str(k) + " "
print(s)

Submission status: Time Limit Exceeded

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

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()
print(" ".join(map(str,b)))

Submission status: Time Limit Exceeded

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

ans = ''
if  (n%2==0): #even
	for i in range(int(n/2)):
		ans = origin[2*i+1]+' '+ans+ ' ' + origin[2*i]
	ans = ans.replace('  ',' ')

else: #odd
	ans =origin[0]
	for i in range(int((n-1)/2)):
		ans =  origin[2*(i+1)]+' '+ans+ ' ' + origin[2*i+1]

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
ans=[]
for i in range(n):
    if (n-1)%2==i%2:
        ans.insert(0,a[i])
    else:
        ans.insert(len(ans),a[i])
print(" ".join(map(str,ans)))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
ans=[]
for i in range(n):
    if (n-1)%2==i%2:
        ans.insert(0,a[i])
    else:
        ans.insert(len(ans),a[i])
for i in range(len(ans)):
    print(ans[i],end=' ')

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int,input().split()))
Q = []

if N % 2 == 0:
    for i in range(N):
        if i % 2 == 0:
            Q.append(P[i])
        else:
            Q.insert(0, P[i])
else:
    for i in range(N):
        if i % 2 == 0:
            Q.insert(0, P[i])
        else:
            Q.append(P[i])
for j in range(N-1):
    print(Q[j], end =" ")
print(Q[N-1])

Submission status: Time Limit Exceeded

Solution code:
# 偶数回目は前に入れる
n = int(input())
l = list(map(int, input().split()))
ans = []
for i in range(n):
  if i == 0:
    ans.append(l[i])
    continue

  if n % 2 == 0:
    if not i % 2 == 0:
      ans.insert(0, l[i])
    else:
      ans.append(l[i])
  else:
    if not i % 2 == 0:
      ans.append(l[i])
    else:
      ans.insert(0, l[i])

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

Submission status: Time Limit Exceeded

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

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

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

B = list(map(str, B))
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(str(a))
    B = B[::-1]

print(" ".join(B))

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python

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

for k,v in enumerate(a):
    if(k%2==0):
        b.insert(0, v)
    else:
        b.append(v)

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

for k,v in enumerate(b):
    print(v, end="")
    if(k!=len(b)-1):
        print(" ", end="")
    else:
        print()

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python

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

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

for k,v in enumerate(b):
    print(v, end="")
    if(k!=len(b)-1):
        print(" ", end="")
    else:
        print()

Submission status: Time Limit Exceeded

Solution code:
_ = raw_input()
args = raw_input()
a = []
for i in args.split(' '):
    a.append(i)
    a.reverse()
print(' '.join(a))

Submission status: Time Limit Exceeded

Solution code:
_ = input()
args = input()
a = []
for i in args.split(' '):
    a.append(i)
    a.reverse()
print(' '.join(a))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(str, input().split(' ')))
F=A[0::2]
L=A[1::2]

ans=[]
an=''
if N%2==0:
    L.reverse()
    ans=L+F
else:
    F.reverse()
    ans=F+L

for i in range(N):
    an=an+' '+str(ans[i])
print(an)

Submission status: Time Limit Exceeded

Solution code:
from collections import deque
n, l, b = input(), raw_input().split(), deque()
for t in xrange(n):
    b.append(l[t])
    b.reverse()
print ' '.join(b)

Submission status: Time Limit Exceeded

Solution code:
import sys
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 _ in b:
    sys.stdout.write(str(_) + " ")
sys.stdout.write("\n")

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])

string = ""
for _ in b:
    string = string + str(_) + " "

print(string[:-1])

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()

string = ""
for _ in b:
    string = string + str(_) + " "

print(string[:-1])

Submission status: Time Limit Exceeded

Solution code:
from collections import deque
N= input()
a = raw_input().split()
#print a

d=deque()
for i,val in enumerate(a):
	if i%2==1:
		d.append(val)
	else:
		d.appendleft(val)
else:
	#print d
	d_str=""
	if N%2==0:
		for j in range(N):
			d_str=d_str+d.pop()+" "
	else:
		for j in range(N):
			d_str=d_str+d.popleft()+" "		
	print d_str[0:-1]

Submission status: Time Limit Exceeded

Solution code:
N= input()
a = raw_input().split()
#print a

b=""
for i,val in enumerate(a):
	if i%2==1:
		if b[-1]==" ":
			b=b+val
		else:
			b=b+" "+val
	else:
		b=val+" "+b
else:
	if N%2==0:
		print b[::-1]
	else:
		print b

Submission status: Time Limit Exceeded

Solution code:
num = int(input())
array = [int(x) for x in input().split()]

res = []
for i in range(0, num):
    if i % 2 == 0:
        res.append(array[i])
    else:
        res.insert(0, array[i])

if num % 2 == 0:
    res = map(str, res)
    print(" ".join(res))
else:
    res = map(str, res[::-1])
    print(" ".join(res))

Submission status: Time Limit Exceeded

Solution code:
from collections import deque


def solve():
    n = int(input())
    a = list(map(int, input().split(" ")))
    d = deque()
    for i in range(n):
        d.append(a[i])
        d.reverse()

    for element in list(d):
        print(element, end = " ")


solve()

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-1):
	print(b[i] ,end=" ")
print(b[n-1])

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a = list(map(str,input().split()))
ans = []

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


print(" ".join(ans))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a = list(map(str,input().split()))
ans = []

for i in range(N):
    ans.append(a[i])
    ans.reverse()
print(" ".join(ans))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = [int(e) for e in input().split(' ')]
b = []
for e in a:
	b.append(e) # ops1
	b.reverse()

ans = ""
for i in range(n):
	if i != 0:
		ans += " "
	ans += str(b[i])

print(ans)

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.insert(0, a[i])
if N % 2 == 1:
    [print(b[i], end=' ') for i in reversed(range(len(b)))]
else:
    [print(b[i], end=' ') for i in range(len(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):
    if i % 2 == 0:
        b.append(a[i])
    else:
        b.insert(0, a[i])
if N % 2 == 1:
    b.reverse()
[print(b[i], end=' ') for i in range(len(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[i], end=' ') for i in range(len(b))]

Submission status: Time Limit Exceeded

Solution code:
count = int(input())
param = [int(v) for v in input().split()]
r = list()
for i in range(count):
  r.append(param[i])
  r.reverse()
  
print(" ".join(map(str, r)))

Submission status: Time Limit Exceeded

Solution code:
N= int(input())

A = list(map(int, input().split()))
A.reverse()
B = []
    
if N%2==0:
    for i in range(N):
        if i%2==0:
            B.append(A.pop())
        else:
            B.insert(0,A.pop())
else:
    for i in range(N):
        if i%2!=0:
            B.append(A.pop())
        else:
            B.insert(0,A.pop())

[print("{} ".format(b),end="") for b in B ]

Submission status: Time Limit Exceeded

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

    b_list = list()
    for i, a in enumerate(a_list):
        c = i+1
        if (c%2 == 0 and n%2 == 0) or (c%2 == 1 and n%2 == 1): b_list.insert(0, a)
        else: b_list.insert(len(b_list), a)

    print(' '.join([str(i) for i in b_list]))


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

    b_list = list()
    for i in range(n):
        b_list.append(a_list[i])
        b_list.reverse()

    print(' '.join([str(i) for i in b_list]))


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

seq_b=[]

for i in range(n):
    seq_b.append(seq_a[i])
    seq_b.reverse()


ans=str(seq_b[0])
for i in range(1,n):
    ans+=' ' +str(seq_b[i])
print(ans)

Submission status: Time Limit Exceeded

Solution code:
def C_pushpush(x):
    n = int(x[0])
    a = x[1:]
    b = []
    n_parity = n & 1
    for i in range(n):
        if n_parity == (i + 1) & 1:
            # n,iのパリティが一致
            b.insert(0, a[i])
        else:
            b.append(a[i])
    print(' '.join(b))

n = input()
l = [i for i in input().split()]
x = [n]+l
C_pushpush(x)

Submission status: Time Limit Exceeded

Solution code:
def C_pushpush(x):
    n = x[0]
    a = x[1:]
    b = []
    n_parity = n & 1
    for i in range(n):
        if n_parity == (i + 1) & 1:
            # n,iのパリティが一致
            b.insert(0, a[i])
        else:
            b.append(a[i])
    for idx in range(len(b)):
        print(b[idx], end=' ')

n = int(input())
l = [int(i) for i in input().split()]
x = [n]+l
C_pushpush(x)

Submission status: Time Limit Exceeded

Solution code:
def C_pushpush(x):
    n = x[0][0]
    a = x[1][:]
    b = []
    n_parity = n & 1
    for i in range(n):
        if n_parity == (i + 1) & 1:
            # n,iのパリティが一致しているか
            b.insert(0, a[i])
        else:
            b.append(a[i])
    for idx in range(len(b)):
        print(b[idx],end=' ')

n = int(input())
l = [int(i) for i in input().split()]
x = [[n]] + [l]
C_pushpush(x)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
array = input().split()
b_list = list()
i = 0

while i < n:
    if i % 2 == 0:
        b_list.append(array[i])
    else:
        b_list.insert(0, array[i])
    i += 1

if len(b_list) % 2 != 0:
    i = len(b_list)-1
    while i >= 0:
        print(b_list[i], end = ' ')
        i -= 1
else:
    i = 0
    while i < len(b_list):
        print(b_list[i], end = ' ')
        i += 1

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
array = input().split()
b_list = list()
i = 0

while i < n:
    b_list.append(int(array[i]))
    new_list = []
    while len(b_list) != 0:
        new_list.append(b_list.pop())
    b_list = list(new_list)
    i += 1

i = 0
while i < n:
    print(b_list[i], end = ' ')
    i += 1