mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-05 02:06:27 +00:00
15 lines
251 B
C++
15 lines
251 B
C++
|
#include <bits/stdc++.h>
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
int main() {
|
||
|
int n, m, v, a, ans = 0;
|
||
|
cin >> n >> v >> m >> a;
|
||
|
for (int i = 1; i <= n; i++) {
|
||
|
ans += v;
|
||
|
if (i % m == 0) v += a;
|
||
|
}
|
||
|
cout << ans << endl;
|
||
|
return 0;
|
||
|
}
|