0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 18:52:02 +00:00

P5534 【XR-3】等差数列

R38704401
This commit is contained in:
Baoshuo Ren 2020-09-21 19:15:08 +08:00 committed by Baoshuo Ren
parent 69ab2a6cce
commit 778250ab66
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

12
problem/P5534/P5534.cpp Normal file
View File

@ -0,0 +1,12 @@
// 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;
}