fb pixel

Arithmetic progression

In arithmetic progression, a starting number is given as , and each next item in the sequence is generated by adding a d integer to it:
This way a long sequence of numbers is constructed.
 
The company you are working for is wondering what the progress of the salaries for their employees will look like if they start from a certain starting salary and increase the salary by d every year?
They are not interested in the numbers higher than a certain threshold, so they ask you to write a program that would print the yearly progress of the salaries up until the specified threshold.
The first line in the input contains the initial salary. The next line is the year-on-year difference in salaries. The final line contains the upper bound, after which the company is not interested in the results anymore.
The program should print the list of salaries the company is interested in.
Input
Output
10000 1000 20000
[10000, 11000, 12000, 13000, 14000, 15000, 16000, 17000, 18000, 19000, 20000]
 
To check your solution you need to sign in
Sign in to continue