From 90375859767eb4cae3a7a93c64725b504d7f0fe0 Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 24 Feb 2021 00:36:15 +0800 Subject: import(life): Add chuanzhi-cup codes. --- works/life/chuanzhi-cup/contest/1.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 works/life/chuanzhi-cup/contest/1.cpp (limited to 'works/life/chuanzhi-cup/contest/1.cpp') diff --git a/works/life/chuanzhi-cup/contest/1.cpp b/works/life/chuanzhi-cup/contest/1.cpp new file mode 100644 index 0000000..4a20d97 --- /dev/null +++ b/works/life/chuanzhi-cup/contest/1.cpp @@ -0,0 +1,22 @@ +#include + +int main() { + int n, v, m, a; + std::scanf("%d%d%d%d", &n, &v, &m, &a); + + int money = 0; + + v -= a; + + for (int i = 0; i < n; i++) { + if (i % m == 0) { + v += a; + } + + money += v; + } + + std::printf("%d", money); + + return 0; +} \ No newline at end of file -- cgit v1.2.3