mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
55762be649
2400-2499
18 lines
311 B
C++
18 lines
311 B
C++
#include <iostream>
|
|
using namespace std;
|
|
int main()
|
|
{
|
|
int n,w,d,s,cha,yuan,ans;
|
|
while((cin>>n>>w>>d>>s)>0)
|
|
{
|
|
yuan=w*n*(n-1)/2;
|
|
cha=yuan-s;
|
|
ans=cha/d;
|
|
if(!ans)
|
|
cout<<n<<endl;
|
|
else
|
|
cout<<ans<<endl;
|
|
}
|
|
return 0;
|
|
}
|