HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN109/111_2016_Questions > problem:


PE07. 51033 - Sum of the series

CEN109/111_2016_Questions

Start: Dec.07.2016 at 12:37:00 PM
Finish: Dec.07.2016 at 01:42:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 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

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.
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