Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int x1,x2,x3,x4,y1,y2,y3,y4,xq,yq,xx,yx,s=0;
- cin>>x1>>y1>>x2>>y2;
- cin>>x3>>y3>>x4>>y4;
- xq=max(min(x1,x2),min(x3,x4));
- xx=min(max(x1,x2),max(x3,x4));
- yq=max(min(y1,y2),min(y3,y4));
- yx=min(max(y1,y2),max(y3,y4));
- if ((xx-xq>0) && (yx-yq>0)) s=(xx-xq)*(yx-yq);
- cout<<s;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement