diff options
author | crupest <crupest@outlook.com> | 2021-02-24 00:36:15 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-02-24 00:36:15 +0800 |
commit | 71d1ec361fda9a119f31099a783b36cc814f4de8 (patch) | |
tree | b698d4f42dd525d1286154236641bfc3e68ceced /chuanzhi-cup/contest/1.cpp | |
parent | 0d5160de7c120de4d7f7bb1344f205f1144afc1f (diff) | |
download | life-71d1ec361fda9a119f31099a783b36cc814f4de8.tar.gz life-71d1ec361fda9a119f31099a783b36cc814f4de8.tar.bz2 life-71d1ec361fda9a119f31099a783b36cc814f4de8.zip |
Add chuanzhi-cup codes.
Diffstat (limited to 'chuanzhi-cup/contest/1.cpp')
-rw-r--r-- | chuanzhi-cup/contest/1.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/chuanzhi-cup/contest/1.cpp b/chuanzhi-cup/contest/1.cpp new file mode 100644 index 0000000..4a20d97 --- /dev/null +++ b/chuanzhi-cup/contest/1.cpp @@ -0,0 +1,22 @@ +#include <cstdio>
+
+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 |