Advertisement
TimxAG

Untitled

Nov 16th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int x1,x2,x3,x4,y1,y2,y3,y4,xq,yq,xx,yx,s=0;
  6. cin>>x1>>y1>>x2>>y2;
  7. cin>>x3>>y3>>x4>>y4;
  8. xq=max(min(x1,x2),min(x3,x4));
  9. xx=min(max(x1,x2),max(x3,x4));
  10. yq=max(min(y1,y2),min(y3,y4));
  11. yx=min(max(y1,y2),max(y3,y4));
  12. if ((xx-xq>0) && (yx-yq>0)) s=(xx-xq)*(yx-yq);
  13. cout<<s;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement