~/algor $ cat problems/progressiya-yigindisi
Sum of a progression
Easy
1000 ms
64 MB
9%
The first term $a$ of an arithmetic progression, its common difference $d$ and the number of terms $n$ are given. The terms are: $a, \; a + d, \; a + 2 * d, \; \ldots$ Find the sum $S$ of the first $n$ terms.
Input
One line with three integers: $a$, $d$ and $n$.
Output
One integer — $S$.
Note
$-10^{6} \le a, d \le 10^{6}$
$1 \le n \le 10^{6}$
Examples
Input #1
1 1 5
Output #1
15
Input #2
10 -3 4
Output #2
22