#B2089. Reverse Array

    ID: 11171 Type: Default 1000ms 256MiB

Reverse Array

Reverse Array

Given an array of integers, reverse the order of its elements.

For example, if the input array is \(8,6,5,4,1\), the reversed array should be \(1,4,5,6,8\).

inputFormat

The first line contains an integer n representing the number of elements in the array. The second line contains n integers separated by spaces.

outputFormat

Output the reversed array in a single line with each element separated by a space.

sample

5
8 6 5 4 1
1 4 5 6 8