0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-27 19:36:28 +00:00
OI-codes/Luogu/P5534/P5534.cpp

13 lines
223 B
C++
Raw Normal View History

2020-09-21 11:15:08 +00:00
// R38704401
#include <bits/stdc++.h>
using namespace std;
int main() {
long long a[2], n;
scanf("%lld%lld%lld", &a[0], &a[1], &n);
cout << n * a[0] + n * (n - 1) * (a[1] - a[0]) / 2 << endl;
return 0;
}