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:
parent
69ab2a6cce
commit
778250ab66
12
problem/P5534/P5534.cpp
Normal file
12
problem/P5534/P5534.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user