From 778250ab66c6d27bb81d26d650e1ed65d6f75c1a Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Mon, 21 Sep 2020 19:15:08 +0800 Subject: [PATCH] =?UTF-8?q?P5534=20=E3=80=90XR-3=E3=80=91=E7=AD=89?= =?UTF-8?q?=E5=B7=AE=E6=95=B0=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R38704401 --- problem/P5534/P5534.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 problem/P5534/P5534.cpp diff --git a/problem/P5534/P5534.cpp b/problem/P5534/P5534.cpp new file mode 100644 index 00000000..68d71015 --- /dev/null +++ b/problem/P5534/P5534.cpp @@ -0,0 +1,12 @@ +// R38704401 + +#include + +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; +}