electicode
HomeCoursesResourcesProblemsNational OlympiadContestsLeaderboard
...

Arithmetic progression

Time Limit: 1000msMemory Limit: 256MB
View Submissions

Problem Description

Given three integers a0a_0a0​, ddd, and nnn. Output the first nnn terms of the arithmetic progression.

An arithmetic progression is a sequence of numbers in which each subsequent term is obtained by adding a constant number ddd to the previous one:
a0, a0+d, a0+2d, …a_0,\ a_0 + d,\ a_0 + 2d,\ \ldotsa0​, a0​+d, a

Input Format

The input contains three integers a0a_0a0​, ddd, and nnn, separated by spaces (1≤a0,d,n≤104)(1 \le a_0, d, n \le 10^4)(1≤a0​.

Output Format

Output a1,a2,…,ana_1, a_2, \ldots, a_na1​,a2​,…,an​, separated by spaces.

Examples

Example 1
Input
7 6 8
Output
13 19 25 31 37 43 49 55

© 2026 Electicode. All rights reserved.

0
​
+
2d, …
,
d
,
n
≤
104)