0分:
#include <bits/stdc++.h>
using namespace std;
long long he,nx,d,xs;
int main()
{
cin>>he>>nx>>xs;
d=nx-he;
cout<<(xs*he+xs*(xs-1)*d)/2;
return 0;
}
100分:
#include <bits/stdc++.h>
using namespace std;
long long he,nx,d,xs;
int main()
{
cin>>he>>nx>>xs;
d=nx-he;
cout<<(xs*he+xs*(xs-1)*d/2);
return 0;
}