Rectangles
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int main()
{
int t,n,j,i,k,o,x,y,s,c[300][300];
scanf("%d",&t);
while(t--)
{
memset(c,0,sizeof(c));
s=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d%d%d",&x,&y,&o);
for(j=x;j<y;j++)
for(k=0;k<o;k++)
c[j][k]++;
}
for(j=0;j<110;j++)
{
for(k=0;k<110;k++)
{
if(c[j][k]>0)
s++;
}
}
printf("%d\n",s);
}
return 0;
}