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

Турниры > CEN109/111_2016_Questions > задача:


PE07. 51033 - Sum of the series

CEN109/111_2016_Questions

Старт: 07.дек.2016 в 12:37:00
Финиш: 07.дек.2016 в 13:42:00
Турнир завершён!
• Турнирная таблица

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

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

• HW1. 51055 - The competition
• HW2. 51056 - Welcome Picnic
• PE01. 51027 - Download Percentage
• PE02. 51028 - Isosceles Triangles
• PE03. 51029 - Buy Three Items
• PE04. 51030 - Number of Right Tria...
• PE05. 51031 - Convert from Hex to...
• PE06. 51032 - Triangle Property
• PE07. 51033 - Sum of the series
• PE08. 51034 - Area of 3 Shapes
• PE09. 51040 - Annual profit
• PE10. 51041 - Plane Segmentation
• PE11. 51038 - Simple interest
• PE12. 51039 - Automated billing system
• RE1. 51077 - Grades Histogram
• RE2. 51078 - Max trade
• hw3. 51057 - Number of students

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

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

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

Sum of the series

Question: In mathematics, sum of the series from 1 to n can be calculated by Equation 1.

From this formula sum of the numbers from a to b can be derived as in Equation 2. Write a program that is going to get two numbers a and b, then the program is going to calculate sum of the series from a to b.

Input specification: You will be given 2 integers (a and b) where 0 ≤ (a and b) ≤ 50,000.

Output specification: Show one number, sum of the numbers from a to b.

Sample Input I
5 10
Sample Input II
1 10000
Sample Output I
45
Sample Output II
50005000

Explanation: To calculate sum of the numbers from 5 to 10, first sum of the numbers from 1 to 10 (55) and sum of the numbers from 1 to 4 (10) are calculated.
Then, 55 - 10 = 45.

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

www.contester.ru