#include <iostream>
using namespace std;

int main() {
    int arr[201][201] = {0,};
    int cnt = 0;
    for (int i = 0;i < 4;i++) {
        int x,y;
        int x2,y2;
        cin >> x >> y >> x2 >> y2;
        for (int j = x;j < x2;j++) {
            for (int k = y;k < y2;k++) {
                arr[j][k] = 1;
            }
        }
    }
    for (int i = 0;i < 200;i++) {
        for (int j = 0;j < 200;j++ ) {
            if (arr[i][j] == 1) {
                cnt++;
            }
        }
    }
    cout << cnt;
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: