I stumbled with this problem in the rectangle geometry section : Problem - C - Codeforces

My approach was too see if the original area of the white sheet remain positive after i minus it with the intersected areas. But it was wrong. Is not the left area after minusing determine if the white sheet is visible or not?

My code :

```
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
struct rect {
ll x1, y1, x2, y2;
ll area() { return((x2 - x1) * (y2 - y1)); }
};
ll intersect(rect a, rect b) {
ll overlapx = max(ll(0), min(a.x2, b.x2) - max(a.x1, b.x1));
ll overlapy = max(ll(0), min(a.y2, b.y2) - max(a.y1, b.y1));
return overlapx * overlapy;
}
int main() {
rect a, b, c;
cin >> a.x1 >> a.y1 >> a.x2 >> a.y2;
cin >> b.x1 >> b.y1 >> b.x2 >> b.y2;
cin >> c.x1 >> c.y1 >> c.x2 >> c.y2;
ll init_area = a.area();
ll inter_anb = intersect(a, b);
ll inter_anc = intersect(a, c);
ll inter_bnc = 0;
if(inter_anb > 0 && inter_anc > 0) {
rect c, d;
c.x1 = max(a.x1, b.x1), c.y1 = max(a.y1, b.y1);
c.x2 = min(a.x2, b.x2), c.y2 = min(a.y2, b.y2);
d.x1 = max(a.x1, c.x1), d.y1 = max(a.y1, c.y1);
d.x2 = min(a.x2, c.x2), d.y2 = min(a.y2, c.y2);
inter_bnc = intersect(c, d);
}
cout << init_area << ' ' << inter_anb << ' ' << inter_anc << ' ' << inter_bnc << '\n';
if(init_area - inter_anb - inter_anc + inter_bnc > 0)
return cout << "YES", 0;
cout << "NO";
}
```