HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Repetition (Loops) > problem:


002. 50365 - Sum of the numbers from a to b

Guest
• Discussion of problem (1)

Volume problems

• 155. 50379 - a^b modulus k
• 158. 50404 - Sum of Self Powers
• 30. 50764 - Fast Typing Competition
• 50303 - Pattern
• 50882 - FizzBuzz
• 50308 - IT Knowledge Seminars
• 50320 - Random Sorted List
• 001. 50385 - From m to n
• 002. 50365 - Sum of the numbe...
• 002. 50452 - Multiplication Table
• 003. 50387 - Passengers in the Train
• 006. 50293 - Sum of odd numbers f...
• 007. 50401 - Sum of Odd Numbers
• 009. 50783 - The smallest number
• 010. 50782 - Max of N integers
• 015. 50466 - Drawing Square From...
• 016. 50463 - Drawing a Triangle

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

Sum of the numbers from a to b

Question:
Write a program that calculates sum of the numbers from a to b with the steps of k.

Input specification
You will be given three integer numbers (a, b, k) where 0 ≤ a < b ≤ 30000 and 0 < k ≤ 100.

Output specification
Show one integer (sum of the numbers from a to b with the steps k).

Sample Input I   
  21 24 1
Sample Input II   
  237 1786 50
Sample Output I   
  90
Sample Output II  
  30597


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

www.contester.ru