#include <iostream>
using namespace std;
int main()
{
int arr[100][100]{0}, i, j, a, b, k, x, y, cnt=0;
for(k=1;k<=4;k++)
{
cin>>a>>b>>x>>y;
for(i=a;i<x;i++)
{
for(j=b;j<y;j++)
{
if(arr[j][i]==0)
{
arr[j][i]++;
cnt++;
}
}
}
}
cout<<cnt;
return 0;
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter