ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Разделы > Unsorted > задача:


50833 - Min of Odd Positions

Гость
• Вопросы к жюри (1)

Задачи раздела

• 50820 - Post Office
• 50810 - Print Office
• 50952 - Derby Tirana
• 50443 - Dajte Express
• 50819 - Linked Numbers
• 50519 - Image Filtering
• 50798 - Passing the course
• 50799 - OSHEE Electric Bill
• 50833 - Min of Odd Positions
• 50821 - Derivative of an array
• 50808 - Total Distance Traveled
• 50452 - Multiplication Table
• 50456 - nth Digit of a Number
• 50817 - The Knight Move
• 50463 - Drawing a Triangle
• 50537 - esreveR Triangle
• 50385 - From m to n

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Ibrahim Mesecan.

Min of Odd Positions

Math professor of your brother has given a homework. He has given a series of numbers. And, he is asking the sum of (min of odd positions) and (max of even positions).

Question: Write a program that is going to read n numbers and show the result.

Input specification
In the first line, you will be an integer, the number of numbers (n) where 0 ≤ n ≤ 40,000. Then, in the following n lines, you will be given n integers where the numbers are between -1e8 and +1e8
Note: The number positions goes from 1 to n.

Output specification:
Show the sum of the minimum of odd positions and the maximum of even positions.

Sample Input I
5
14 30 17 26 85
Sample Output I
44

Explanation: There are 3 numbers in odd positions: 14, 17 and 85. And, the min of odd positions is 14. The max of even positions is 30. So, the sum is 44.



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

www.contester.ru