#include using namespace std; int T; int x11,x12,y11,y12,x21,x22,y21,y22; int main(){ cin>>T; while(T--){ cin>>x11>>y11>>x12>>y12; cin>>x21>>y21>>x22>>y22; int res = (x12-x11)*(y12-y11); res += (x22-x21)*(y22-y21); int x31 = x21>?x11; int x32 = x22?y11; int y32 = y22?0)*((y32-y31)>?0); cout<