Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- #include<cmath>
- using namespace std;
- int main()
- {
- int w,h,u1,u2,h1,h2,a[110],i,j;
- for(i=0;i<=100;i++){
- a[i]=0;
- }
- cin>>w>>h;
- cin>>u1>>h1;
- a[h1]=u1;
- cin>>u2>>h2;
- a[h2]=u2;
- for(i=h;i>=0;i--){
- w+=i;
- w-=a[i];
- if(w<0)
- w=0;
- }
- cout<<w<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement