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

Турниры > SEM 2 - W5 > задача:


1. 50381 - Sum of the numbers

SEM 2 - W5

Старт: 04.апр.2023 в 16:12:08
Финиш: 10.апр.2023 в 20:12:08
Турнир завершён!
• Турнирная таблица

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

Задачи турнира

• 50293 - Sum of odd numbers from ...
• 50727 - Fibonacci Numbers
• 50782 - Max of N integers
• 50554 - Fuqia e n-t e m (2)
• 50783 - Numri me i vogel
• 1. 50381 - Sum of the numbers

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

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

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

Sum of the numbers

Question:
You will be given n numbers. Calculate sum of the numbers in the positions from a to b.

Input specification
You will be given three numbers (n, a and b) then in the following n lines, you will be given n numbers 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
In the first line, show the sum of the numbers from a to b. That will be followed by the numbers in the positions from a to b.

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


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

www.contester.ru