# Help in USACO Bronze Blocked Billboard II

## Problem Info

Blocked Billboard II

## My Work

``````#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define debug(x) cout<<":["<<x<<"XE]"<<endl;
#define debug2(x,y) cout<<":["<<x<<" "<<y<<"XE]"<<endl;
#define _ ios_base::sync_with_stdio(false);
#define mod 1000000007
#define mod2 998244353

struct rect
{
int x1,y1,x2,y2;
};

int main()
{_
ll t=1,ca=1;
//cin>>t;
while(t--){
freopen("billboard.in","r",stdin);
freopen("billboard.out","w",stdout);
rect a,a2,b;
cin>>a.x1>>a.y1>>a.x2>>a.y2;
cin>>a2.x1>>a2.y1>>a2.x2>>a2.y2;

ll c=min(a.x2,a2.x2)-max(a.x1,a2.x1);
ll d=min(a.y2,a2.y2)-max(a.y1,a2.y1);
//c=max(c,0ll);
//d=max(d,0ll);
ll ans=abs(a.x2-a.x1)*abs(a.y2-a.y1);
if((c>0&&d>0)&&(c==a.x2-a.x1||d==a.y2-a.y1))ans-=c*d;
//ans=max(ans,0ll);
cout<<ans;
}
}

``````

## What I’ve Tried

I have just determined the intersection rectangle’s height and width and checked if anyone matched the 1st rectangle’s height or weight.

## Question

Can anyone please give a corner case or say why my solution is wrong? (Only 4th case got wrong)