Write first-last and so on elements X85811


Statement
 

pdf   zip

Given a sequence of integers x0,,xn1x_0,\ldots,x_{n-1}, write again these nn elements to the output in the following order: x0,xn1,x1,xn2,x2,xn3,x_0,x_{n-1},x_1,x_{n-2},x_2,x_{n-3},\ldots.

Exam score: 2.5 Automatic part: 100%

Input

The input has several cases, each one described in a diferent line. Each case starts with a natural number n1n\geq 1 followed by nn integers x0,,xn1x_0,\ldots,x_{n-1}.

Output

Write the corresponding answer for each case in a different line, separating the elements of each sequence with blank spaces.

Public test cases
  • Input

    5 1 2 3 4 5
    6 -3 3 -4 4 -5 -5
    

    Output

    1 5 2 4 3
    -3 -5 3 -5 -4 4
    
  • Information
    Author
    Professorat de PRO1
    Language
    English
    Official solutions
    C++
    User solutions
    C++