#include<bits/stdc++.h> using namespace std; int n,m,a,v; int ans,tot; int main(){ cin>>n>>v>>m>>a; while(1){ if(tot==n){ cout<<ans; return 0; } for(int i=1;i<=m;i++){ ans+=v; } v+=a; tot++; } return 0; }
愿高手赐教