int computeArea(int A, int B, int C, int D, int E, int F, int G, int H) {

return (min(max(A,C),max(E,G))<max(min(A,C),min(E,G)) || min(max(B,D),max(F,H))<max(min(F,H),min(B,D)))? abs((C-A)*(D-B))+abs((G-E)*(H-F)): abs((C-A)*(D-B))+abs((G-E)*(H-F))-(min(max(A,C),max(E,G))-max(min(A,C),min(E,G)))*(min(max(B,D),max(F,H))-max(min(F,H),min(B,D)));

}