HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Array and Matrices > problem:


060. 50389 - Reverse an Array

Guest
• Review clarifications (1)

Volume problems

• 50758 - National Elections - Revisited
• 50458 - Weekly Report
• Raporti Javor
• 50555 - Frequency of Letters
• 50592 - Matrix Multiplication
• 50653 - Long Divide
• 50767 - Censor
• 50792 - The student with the highest...
• 060. 50389 - Reverse an Array
• 100. 50330 - Find the average of n ...
• 110. 50359 - Mode of a Series
• 120. 50329 - Draw Matrix-1
• 120. 50331 - Number of Numbers o...
• 155. 50726 - Pascal Triangle - 1
• 180. 50755- Top N Donors - 1
• 190. 50734 - Product Info (In Srt)
• 200. 50290 - Minimax Sum

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Prepared by Ibrahim Mesecan.

Reverse an Array

Question:
You will be given n numbers. Reverse the elements in the positions a through b.

Input specification
In the first line, you will be given three numbers (n, a and b). Then, in the following line, you will be given comma-separated n integers which are between -10000 and 10000 where n is between 1 and 10000 and 1 ≤ a ≤ b ≤ n.
Note: Assume that the number positions are from 1 to n.

Output specification
After reversing the numbers in the positions a through b, show all the numbers (show numbers by separating spaces).

Sample Input I   
  8 6 7
  -2, 3, 3, 6, 5, 3, 9, -7,
Sample Input II   
  10 3 5
  5, -7, 3, 4, 5, 6, 7, -8, 2, 9,
Sample Output I   
  -2 3 3 6 5 9 3 -7
Sample Output II   
  5 -7 5 4 3 6 7 -8 2 9


Для отправки решений необходимо выполнить вход.

www.contester.ru