import java.util.*;

//This is the only thing I could be 100% certain about.
//But even still it is very difficult to comprehend this logic let alone the main code.
//This provides information if the configurations are invalid.

public class Solution 
{
    public static int overlappingArea(int[] rect1BottomLeft, int[] rect1TopRight, int[] rect2BottomLeft, int[] rect2TopRight) 
    {
        int width=0;
        int height=0;
        boolean hasExactOverlap=false;
        
        System.out.println("rect1Topright Y: " + rect1TopRight[1]);
        System.out.println("rect1Topright X: " + rect1TopRight[0]);
        System.out.println("rect1BottomLeft Y: " + rect1BottomLeft[1]);
        System.out.println("rect1BottomLeft X: " + rect1BottomLeft[0]);
        
        System.out.println("rect2Topright Y: " + rect2TopRight[1]);
        System.out.println("rect2Topright X: " + rect2TopRight[0]);
        System.out.println("rect2BottomLeft Y: " + rect2BottomLeft[1]);
        System.out.println("rect2BottomLeft X: " + rect2BottomLeft[0]);
        
        if  ((rect1BottomLeft[0]) >= (rect1TopRight[0])  
        ||  (rect2BottomLeft[0]) >= (rect2TopRight[0])
	//||(rect1BottomLeft[1]) >= (rect1TopRight[1]) 
        //||(rect2BottomLeft[1]) >= (rect2TopRight[1]))
        {
            System.out.println("INVALID RECTANGLE CONFIGURATION");
            return 0;
        }
    
        if (rect1BottomLeft[0]>=rect2TopRight[0]
            || (rect2BottomLeft[0]>=rect1TopRight[0])
            || (rect1BottomLeft[1]>=rect2TopRight[1])
            || (rect2BottomLeft[1]>=rect1TopRight[1]))
        {
            System.out.println("NO OVERLAP FOUND");
            return 0;
        }
           
        //now need to focus on exact overlap. These seem to be ONLY scenario guaranteed to present exact overlap outcome
        
        System.out.println("rect1Topright: " + rect1TopRight[1]);
        System.out.println("rect2TopRight: " + rect2TopRight[1]);
        System.out.println("rect1BottomLeft: " + rect1BottomLeft[1]);
        System.out.println("rect2BottomLeft: " + rect2BottomLeft[1]);
        
        if (rect1TopRight[1]==rect2TopRight[1]
            &&(rect1BottomLeft[1]==rect2BottomLeft[1])
            &&(rect1TopRight[0]==rect2TopRight[0])
            &&(rect1BottomLeft[0]==rect2BottomLeft[0]))
        {
            System.out.println("EXACT overlap");
            hasExactOverlap=true;
                  
            if ((rect2BottomLeft[1]<0 && rect2TopRight[1]>0))
            {
                width = Math.abs(0-rect2BottomLeft[0]) + Math.abs(0-rect2TopRight[0]);
                height = Math.abs(0-rect2BottomLeft[1]) + Math.abs(0-rect2TopRight[1]);
            }
            else
            {
                width = Math.abs(0-rect2BottomLeft[0]) - Math.abs(0-rect2TopRight[0]);
                System.out.println(width);
                height = Math.abs(0-rect2BottomLeft[1]) - Math.abs(0-rect2TopRight[1]);
                System.out.println(height);
            }
            System.out.println(width);
             System.out.println(height);
            
            return (Math.abs(width) * Math.abs(height));
        }
              
        //this is now if there is violation and overlap spans four quadrants.
        //it would be quite impossible to calculate
        //but this is mechanism I have devised since strictly it is not an invalid configuration
        
        if (!hasExactOverlap)
        {
            if ((rect1BottomLeft[0]<0) && (rect1TopRight[0]>0)
                && (rect2BottomLeft[0]<0) && (rect2TopRight[0]>0))
            {
                System.out.println("CHECKING OVERLAP 4 QUADRANTS");
            
                if ((rect1BottomLeft[1]<0) && (rect1TopRight[1]>0)
                    && (rect2BottomLeft[1]<0) && (rect2TopRight[1]>0))
                {
                    System.out.println("VIOLATION");
                    return 0;
                }
            }
        }
        
        /*    
        //at this point it has validated and this would be a good starting point to ensure both rectangles in
        //positive quadrant
         if ((rect1BottomLeft[1]>=0 && rect2BottomLeft[1]>0  
            && (rect1TopRight[1]>=0 && rect2TopRight[1]>=0)))
        {
                    
        }
        
        */
        
        
        /*
        //***************************************************************************************
        //I BELIEVE IF I WANT TO TACKLE THIS PROBLEM AGAIN, I NEED TO CONSIDER A STRUCTURE SIMILAR TO BELOW
        //AND JUST EXPAND OUTWARDS INLINE WITH REQUIREMENTS OF THE TEST CASES
        //***************************************************************************************
        
		//if both topright above X axis
		  //If top right coordinate of rectangle is on or above the X axis
					
		if (rect2TopRight[0]>=0 && rect1TopRight[0]>=0)
		{
		    if (rect2TopRight[0]>=rect1TopRight[0])
            {
                if (rect2BottomLeft[0]<=rect1BottomLeft[0])
                {
                    width = Math.abs(0-rect1BottomLeft[0]) + Math.abs(0-rect1TopRight[0]);
                    height = Math.abs(0-rect2BottomLeft[1]) - Math.abs(0-rect2TopRight[1]);
                    System.out.println(width);
                    System.out.println(height);
            
                    return (Math.abs(width) * Math.abs(height));
                }
                else
                {
                    width = Math.abs(0-rect2BottomLeft[0]) - Math.abs(0-rect1TopRight[0]);
                    height = Math.abs(0-rect2BottomLeft[1]) - Math.abs(0-rect1TopRight[1]);
                    System.out.println("MUST38");
                    System.out.println(width);
                    System.out.println(height);
            
                    return (Math.abs(width) * Math.abs(height));
                }
            }
        }
        if (rect1TopRight[0]>=rect2TopRight[0])
        {
            if (rect1BottomLeft[0]<=rect2BottomLeft[0])
            {
                width = Math.abs(0-rect2BottomLeft[0]) + Math.abs(0-rect2TopRight[0]);
                height = Math.abs(0-rect1BottomLeft[1]) - Math.abs(0-rect1TopRight[1]);
                System.out.println(width);
                System.out.println(height);
            
                return (Math.abs(width) * Math.abs(height));
            }
            else
            {
                width = Math.abs(0-rect1BottomLeft[0]) - Math.abs(0-rect2TopRight[0]);
                height = Math.abs(0-rect1BottomLeft[1]) - Math.abs(0-rect2TopRight[1]);
                System.out.println("MUST39");
                System.out.println(width);
                System.out.println(height);
            
                return (Math.abs(width) * Math.abs(height));
            }
        }
        
        
        //If top right coordinate of rectangle is below the X axis

        if (rect2TopRight[0]<0 && rect1TopRight[0]<0)
		{
		    if (rect1TopRight[0]>=rect2TopRight[0])
            {
                if (rect1BottomLeft[0]<=rect2BottomLeft[0])
                {
                    width = Math.abs(0-rect2BottomLeft[0]) + Math.abs(0-rect2TopRight[0]);
                    height = Math.abs(0-rect1BottomLeft[1]) - Math.abs(0-rect1TopRight[1]);
                    System.out.println(width);
                    System.out.println(height);
            
                    return (Math.abs(width) * Math.abs(height));
                }
                else
                {
                    width = Math.abs(0-rect1BottomLeft[0]) + Math.abs(0-rect2TopRight[0]);
                    height = Math.abs(0-rect1BottomLeft[1]) - Math.abs(0-rect1TopRight[1]);
                    System.out.println("MUST41");
                    System.out.println(width);
                    System.out.println(height);
            
                    return (Math.abs(width) * Math.abs(height));
                }
            }
            if (rect2TopRight[0]>=rect1TopRight[0])
            {
                //we are here because of test case 70 and 71
                if (rect2BottomLeft[0]<=rect1BottomLeft[0])
                {
                    width = Math.abs(0-rect1BottomLeft[0]) + Math.abs(0-rect1TopRight[0]);
                    height = Math.abs(0-rect2BottomLeft[1]) - Math.abs(0-rect2TopRight[1]);
                    System.out.println(width);
                    System.out.println(height);
            
                    return (Math.abs(width) * Math.abs(height));
                }
                else
                {
                    width = Math.abs(0-rect2BottomLeft[0]) + Math.abs(0-rect1TopRight[0]);
                    height = Math.abs(0-rect2BottomLeft[1]) - Math.abs(0-rect2TopRight[1]);
                    System.out.println("MUST40");
                    System.out.println(width);
                    System.out.println(height);
            
                    return (Math.abs(width) * Math.abs(height));
                }
            }
        }
	//*************************************************************************************

        System.out.println("width:" + width);
        System.out.println("height: " + height);
            
        return (Math.abs(width) * Math.abs(height));
    }
    */
    return (Math.abs(width) * Math.abs(height));
    }
    
    public static void main (String[] args)
    {
        //TEST CASE 1 - NO OVERLAP, BUT ALSO INVALID CONFIGURATION (THIS TAKES PRECEDENCE)
        //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-8, 2},  new int[]{-6, 2},new int[]{-6, 2}, new int[]{-5, 5}));
                                                                   //rect1bottomLeft     //rect1TopRight   //rect2BottomLeft    //rect2TopRight
        //TEST CASE 2 - EXACT OVERLAP
        //System.out.println("The overlapping area is: " + overlappingArea(new int[]{3, 3},  new int[]{6, 6},new int[]{3, 3}, new int[]{6, 6}));
                                                                   //rect1bottomLeft     //rect1TopRight   //rect2BottomLeft    //rect2TopRight
        //TEST CASE 3 - EXACT OVERLAP (store)
         //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-9, 0},  new int[]{-6, 3},new int[]{-9, 0}, new int[]{-6, 3}));
                                                                   //rect1bottomLeft     //rect1TopRight   //rect2BottomLeft    //rect2TopRight
        //TEST CASE 4 - EXACT OVERLAP
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{0, -2},  new int[]{3, 1},new int[]{0, -2}, new int[]{3, 1}));
                                                                   //rect1bottomLeft     //rect1TopRight   //rect2BottomLeft    //rect2TopRight
        //TEST CASE 5 - EXACT OVERLAP
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-1, -1},  new int[]{2, 2},new int[]{-1, -1}, new int[]{2, 2}));
                                                                  //rect1bottomLeft     //rect1TopRight   //rect2BottomLeft    //rect2TopRight
        //TEST CASE 6 - EXACT OVERLAP
        //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-6, -5},  new int[]{-3, -2},new int[]{-6, -5}, new int[]{-3, -2}));
                                                                   //rect1bottomLeft     //rect1TopRight   //rect2BottomLeft    //rect2TopRight
        
        //TEST CASE 7 - EXACT OVERLAP
        //System.out.println("The overlapping area is: " + overlappingArea(new int[]{4, -5},  new int[]{7, -2},new int[]{4, -5}, new int[]{7, -2}));
                                                               //rect1bottomLeft     //rect1TopRight   //rect2BottomLeft    //rect2TopRight
       
        //TEST CASE 50 - violation all four quadrants overlap
        //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-2, -1},  new int[]{1, 2},new int[]{-3, -2}, new int[]{3, 1}));
        
        //TEST CASE 51 - flip of the above - violation all four quadrants overlap
        //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-3, -2}, new int[]{3, 1},new int[]{-2, -1},  new int[]{1, 2}));
       
        //TEST CASE 84 - invalid configuration
        //System.out.println("The overlapping area is: " + overlappingArea(new int[]{5, 2}, new int[]{4, 3},new int[]{2, 1},  new int[]{7, 4}));

        //TEST CASE 85 - dimensionless error
        System.out.println("The overlapping area is: " + overlappingArea(new int[]{5, 2}, new int[]{9, 2},new int[]{2, 1},  new int[]{7, 4}));
        
        //TEST CASE 86 - dimensionless error
        //System.out.println("The overlapping area is: " + overlappingArea(new int[]{5, 2}, new int[]{9, 6},new int[]{3, 1},  new int[]{3, 4}));

        



        //TEST CASE 8
        //System.out.println("The overlapping area is: " + overlappingArea(new int[]{3, 1},  new int[]{6, 4},new int[]{4, 2}, new int[]{7, 5}));
        //                                                           //rect1bottomLeft     //rect1TopRight   //rect2BottomLeft    //rect2TopRight
        
      
       //TEST CASE 9 - (flip of test case 8)
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{4, 2}, new int[]{7, 5},new int[]{3, 1},  new int[]{6, 4}));
        //                                                           //rect1bottomLeft     //rect1TopRight   //rect2BottomLeft    //rect2TopRight
        
        //TEST CASE 10 (STORE)
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{4, 2}, new int[]{7, 5},new int[]{4, 2},  new int[]{9, 6}));
        //                                                           //rect1bottomLeft     //rect1TopRight   //rect2BottomLeft    //rect2TopRight
        
      //TEST CASE 11   same as above flipped (STORE)
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{4, 2},  new int[]{9, 6},new int[]{4, 2}, new int[]{7, 5}));
        //
        
         //TEST CASE 12   this will follow same principle as test case 10 (STORE)
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{3, 1},  new int[]{9, 6},new int[]{4, 2}, new int[]{7, 5}));
        //     
        
        //TEST CASE 13   same as above, but flipped  (PASSED BUT TWO STORES!!)
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{4, 2}, new int[]{7, 5},new int[]{3, 1},  new int[]{9, 6}));
        //
        
        //TEST CASE 12NEW   this will follow same principle as test case 10 (STORE)
         //System.out.println("The overlapping area is: " + overlappingArea(new int[]{3, 1},  new int[]{9, 6},new int[]{4, 2}, new int[]{5, 4}));
        //  
        
         //TEST CASE 13NEW   this will follow same principle as test case 10 (into 2 x must areas), (into store, benefitted smaller value)
         //System.out.println("The overlapping area is: " + overlappingArea(new int[]{4, 2}, new int[]{5, 4},new int[]{3, 1},  new int[]{9, 6}));
        // 
        
          //TEST CASE 14  (into 2 x must areas)
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{3, 1}, new int[]{9, 6},new int[]{6, 3},  new int[]{9, 6}));
        //    
        
            //TEST CASE 15   same as above, but flipped (into 3 x must areas)
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{6, 3},  new int[]{9, 6},new int[]{3, 1}, new int[]{9, 6}));
        //
        
        //TEST CASE 14new  
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-5, 1},  new int[]{1, 6},new int[]{-2, 3}, new int[]{0, 6}));
        //
        
        //TEST CASE 15new   same as above, but flipped (into 2 x must areas)
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-2, 3}, new int[]{1, 6},new int[]{-5, 1},  new int[]{1, 6}));
        //
        
        
        //TEST CASE 14  - explore nested arrangement 1 (store)
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{2, 1}, new int[]{6, 4},new int[]{2, 1},  new int[]{8, 6}));
        //
        
        //TEST CASE 15  - explore nested arrangement 1 (store)
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{2, 1},  new int[]{8, 6},new int[]{2, 1}, new int[]{5, 4}));
        //
        
        //TEST CASE 14  - explore nested arrangement 2 (into 2 x must areas)
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{2, 4}, new int[]{6, 6},new int[]{2, 1},  new int[]{8, 6}));
        //
        
        //TEST CASE 15  - explore nested arrangement 2
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{2, 1},  new int[]{8, 6},new int[]{2, 4}, new int[]{6, 6}));
        //
        
        //TEST CASE 14  - explore nested arrangement 3 (store)
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{2, 1},  new int[]{8, 6},new int[]{4, 1}, new int[]{8, 4}));
        //
        
        //TEST CASE 15  - explore nested arrangement 3 (store)
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{4, 1}, new int[]{8, 4},new int[]{2, 1},  new int[]{8, 6}));
        //
        
        //TEST CASE 14  - explore nested arrangement 4 (STORE)
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{2, 1},  new int[]{8, 6},new int[]{3, 1}, new int[]{7, 3}));
        //
        
               //TEST CASE 15  - explore nested arrangement 4 (STORE x 2)
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{3, 1}, new int[]{7, 3},new int[]{2, 1},  new int[]{8, 6}));
        //
        
        //TEST CASE 14  - explore nested arrangement 5 (STORE)
         //System.out.println("The overlapping area is: " + overlappingArea(new int[]{2, -5},  new int[]{8, -2},new int[]{3, -4}, new int[]{8, -2}));
        //
        
         //TEST CASE 15  - explore nested arrangement 5 (STORE)
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{3, -4}, new int[]{8, -2},new int[]{2, -5},  new int[]{8, -2}));
        //
        
         //TEST CASE 14  - explore nested arrangement 6
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-7, -3}, new int[]{-2, -1},new int[]{-8, -4},  new int[]{-2, -1}));
        //
        
        //TEST CASE 15  - explore nested arrangement 6
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-8, -4},  new int[]{-2, -1},new int[]{-7, -3}, new int[]{-2, -1}));
        //
        
          //TEST CASE 14  - explore nested arrangement 7
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-8, -3},  new int[]{-2, 6},new int[]{-7, 4}, new int[]{-2, 6}));
        //
        
         //TEST CASE 15  - explore nested arrangement 7
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-7, 4}, new int[]{-2, 6},new int[]{-8, -3},  new int[]{-2, 6}));
        //
        
        //TEST CASE 16  - 
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{6, 3}, new int[]{9, 4},new int[]{6, 3},  new int[]{9, 6}));
        //
        
         //TEST CASE 17  - same as above, but flipped
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{6, 3},  new int[]{9, 6},new int[]{6, 3}, new int[]{9, 4}));
        //
        
        //TEST CASE 16new  - 
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-6, -5}, new int[]{-3, -4},new int[]{-6, -5},  new int[]{-3, -2}));
        //
        
        //TEST CASE 17new  - 
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-6, -5},  new int[]{-3, -2},new int[]{-6, -5}, new int[]{-3, -4}));
        //
        
        
         //TEST CASE 18
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{6, 3}, new int[]{9, 6},new int[]{6, 5},  new int[]{9, 6}));
        //    
        
         //TEST CASE 19, same as above but flipped
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{6, 5},  new int[]{9, 6},new int[]{6, 3}, new int[]{9, 6}));
        //   
        
        
        //TEST CASE 20
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{6, 3},  new int[]{9, 6},new int[]{8, 3}, new int[]{9, 6}));
        // 
        
         //TEST CASE 21, same as above but flipped
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{8, 3}, new int[]{9, 6},new int[]{6, 3},  new int[]{9, 6}));
          // 
        
        
      //TEST CASE 22
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{5, 2}, new int[]{6, 6},new int[]{4, 3},  new int[]{7, 5}));
          // 
          
          //TEST CASE 23 - flip of the above
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{4, 3},  new int[]{7, 5},new int[]{5, 2}, new int[]{6, 6}));
          // 
       
        //TEST CASE 22new1
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{7, 2}, new int[]{8, 6},new int[]{4, 3},  new int[]{8, 5}));
          // 
          
          //TEST CASE 23new1 - flip of the above 
         //System.out.println("The overlapping area is: " + overlappingArea(new int[]{4, 3},  new int[]{8, 5},new int[]{7, 2}, new int[]{8, 6}));
          //
          
          //TEST CASE 22new2
         //System.out.println("The overlapping area is: " + overlappingArea(new int[]{4, 0},  new int[]{5, 6},new int[]{4, 2}, new int[]{8, 4}));
          // 
     
        //TEST CASE 23new2 - flip of the above 
         //System.out.println("The overlapping area is: " + overlappingArea(new int[]{4, 2}, new int[]{8, 4},new int[]{4, 0},  new int[]{5, 6}));
          //
       
          
             //TEST CASE 24
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{4, 1},  new int[]{8, 3},new int[]{4, 2}, new int[]{8, 4}));
          // 
          
               //TEST CASE 25  - flip of the above
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{4, 2}, new int[]{8, 4},new int[]{4, 1},  new int[]{8, 3}));
          //
          
           //TEST CASE 24new
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-6, -5}, new int[]{-2, -3},new int[]{-6, -4},  new int[]{-2, -2}));
          //
          
                //TEST CASE 25new  - flip of the above
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-6, -4},  new int[]{-2, -2},new int[]{-6, -5}, new int[]{-2, -3}));
          //
          
           //TEST CASE 26
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{2, 1}, new int[]{4, 4},new int[]{4, 2},  new int[]{8, 4}));
          //
          
           //TEST CASE 27 - flip of the above
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{4, 2}, new int[]{8, 4},new int[]{2, 1},  new int[]{4, 4}));
          //
          
          //TEST CASE 26new
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-8, -5}, new int[]{-6, -2},new int[]{-6, -4},  new int[]{-2, -2}));
          //
          
          //TEST CASE 27new
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-6, -4},  new int[]{-2, -2},new int[]{-8, -5}, new int[]{-6, -2}));
          //
          
          
          //TEST CASE 28
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{2, 2}, new int[]{4, 5},new int[]{4, 2},  new int[]{8, 4}));
          //
          
           //TEST CASE 29 - flip of the above
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{4, 2},  new int[]{8, 4},new int[]{2, 2}, new int[]{4, 5}));
          //
          
          //TEST CASE 30
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{2, 1},  new int[]{4, 5},new int[]{4, 2}, new int[]{8, 4}));
          //
          
          //TEST CASE 31 - flip of the above
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{4, 2}, new int[]{8, 4},new int[]{2, 1},  new int[]{4, 5}));
          //
          
          //TEST CASE 32
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{2, 1}, new int[]{4, 5},new int[]{3, 3},  new int[]{7, 6}));
          //
          
          //TEST CASE 33 - flip of the above
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{3, 3},  new int[]{7, 6},new int[]{2, 1}, new int[]{4, 5}));
          //
               
          //TEST CASE 34
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-8, 1},  new int[]{-6, 5},new int[]{-7, 3}, new int[]{-3, 6}));
          //
          
           //TEST CASE 35 - flip of the above
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-7, 3}, new int[]{-3, 6},new int[]{-8, 1},  new int[]{-6, 5}));
          //
          
          
          //TEST CASE 36
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-6, -2}, new int[]{-4, 2},new int[]{-5, 0},  new int[]{-1, 3}));
          //
          
           //TEST CASE 37 - flip of the above
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-5, 0},  new int[]{-1, 3},new int[]{-6, -2}, new int[]{-4, 2}));
          //
          
          //TEST CASE 38
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-4, -3},  new int[]{-1, -1},new int[]{-2, -4}, new int[]{2, 2}));
          //
          
             //TEST CASE 39 - flip of the above
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-2, -4}, new int[]{2, 2},new int[]{-4, -3},  new int[]{-1, -1}));
          //
          
           //TEST CASE 40
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-4, 2}, new int[]{-1, 4},new int[]{-2, 1},  new int[]{2, 3}));
          //
          
           //TEST CASE 41 - flip of the above
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-2, 1},  new int[]{2, 3},new int[]{-4, 2}, new int[]{-1, 4}));
          //
          
           //TEST CASE 42
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{3, 2},  new int[]{6, 4},new int[]{5, 1}, new int[]{9, 3}));
          //
          
          //TEST CASE 43 - flip of the above
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{5, 1}, new int[]{9, 3},new int[]{3, 2},  new int[]{6, 4}));
          //
          
          //TEST CASE 44
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-4, -4}, new int[]{0, -2},new int[]{-6, -3},  new int[]{-3, 1}));
          //
          
           //TEST CASE 45 - flip of the above
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-6, -3},  new int[]{-3, 1},new int[]{-4, -4}, new int[]{0, -2}));
          //
          
          //TEST CASE 46
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-6, 1},  new int[]{-2, 3},new int[]{-8, 2}, new int[]{-5, 4}));
          //
          
          //TEST CASE 47 - flip of the above
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-8, 2}, new int[]{-5, 4},new int[]{-6, 1},  new int[]{-2, 3}));
          //
          
          //TEST CASE 48
           //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-2, 1}, new int[]{2, 3},new int[]{-3, 2},  new int[]{1, 4}));
          //
          
            //TEST CASE 49  - flip of the above
           //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-3, 2},  new int[]{1, 4},new int[]{-2, 1}, new int[]{2, 3}));
          //
          
         
          
          //TEST CASE 52
           //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-4, -6}, new int[]{4, -3},new int[]{-2, -5},  new int[]{5, -4}));
          //
          
          //TEST CASE 53- flip of the above
           //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-2, -5},  new int[]{5, -4},new int[]{-4, -6}, new int[]{4, -3}));
          //
          
          //TEST CASE 54
           //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-3, 1},  new int[]{4, 4},new int[]{-4, 3}, new int[]{3, 4}));
          //
          
          //TEST CASE 55
           //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-4, 3}, new int[]{3, 4}, new int[]{-3, 1},  new int[]{4, 4}));
          //
          
           //TEST CASE 56
           //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-4, 1}, new int[]{3, 2}, new int[]{-3, 1},  new int[]{4, 4}));
          //
          
          //TEST CASE 57
           //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-3, 1},  new int[]{4, 4},new int[]{-4, 1}, new int[]{3, 2}));
          //
          
          
          //TEST CASE 58
           //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-4, 1},  new int[]{5, 2},new int[]{-3, 1}, new int[]{4, 4}));
          //
          
          //TEST CASE 59
           //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-3, 1}, new int[]{4, 4},new int[]{-4, 1},  new int[]{5, 2}));
          //
          
          //TEST CASE 60
           //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-5, -3}, new int[]{2, -2},new int[]{-4, -5},  new int[]{3, -2}));
          //
          
           //TEST CASE 61
           //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-4, -5},  new int[]{3, -2},new int[]{-5, -3}, new int[]{2, -2}));
          //
          
          //TEST CASE 62
           //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-5, -5},  new int[]{2, -4},new int[]{-4, -5}, new int[]{3, -2}));
          //
          
          //TEST CASE 63
           //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-4, -5}, new int[]{3, -2},new int[]{-5, -5},  new int[]{2, -4}));
          //
          
           //TEST CASE 64
           //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-5, -5}, new int[]{6, -3},new int[]{-4, -5},  new int[]{3, -2}));
          //
          
           //TEST CASE 65
           //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-4, -5},  new int[]{3, -2},new int[]{-5, -5}, new int[]{6, -3}));
          //
          
           //TEST CASE 66
           //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-5, -3},  new int[]{6, -2},new int[]{-4, -5}, new int[]{3, -2}));
          //
          
          //TEST CASE 67
           //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-4, -5}, new int[]{3, -2},new int[]{-5, -3},  new int[]{6, -2}));
          //
          
          //TEST CASE 68
           //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-4, -3}, new int[]{6, -2},new int[]{-4, -5},  new int[]{3, -2}));
          //
          
          //TEST CASE 69
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-4, -5},  new int[]{3, -2},new int[]{-4, -3}, new int[]{6, -2}));
          //
          
          //TEST CASE 70
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-4, -5},  new int[]{3, -2},new int[]{-1, -3}, new int[]{6, -2}));
          //
          
          //TEST CASE 71
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-1, -3}, new int[]{6, -2},new int[]{-4, -5},  new int[]{3, -2}));
          //
          
          //TEST CASE 72
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-3, 1}, new int[]{4, 4},new int[]{-1, -2},  new int[]{8, 3}));
          //
          
          //TEST CASE 73
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-1, -2},  new int[]{8, 3},new int[]{-3, 1}, new int[]{4, 4}));
          //
          
          
          //TEST CASE 74
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-3, 1},  new int[]{4, 4},new int[]{-1, 2}, new int[]{4, 3}));
          //
          
          //TEST CASE 75
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-1, 2}, new int[]{4, 3},new int[]{-3, 1},  new int[]{4, 4}));
          //
          
          //TEST CASE 76
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-4, -5}, new int[]{3, -2},new int[]{-1, -4},  new int[]{3, -3}));
          //
          
          //TEST CASE 77
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-1, -4},  new int[]{3, -3},new int[]{-4, -5}, new int[]{3, -2}));
          //
          
           //TEST CASE 78
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-4, -5},  new int[]{3, -2},new int[]{-1, -4}, new int[]{5, -3}));
          //
          
          //TEST CASE 79
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-1, -4}, new int[]{5, -3},new int[]{-4, -5},  new int[]{3, -2}));
          //
          
           //TEST CASE 80
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{2, 1}, new int[]{9, 4},new int[]{6, 2},  new int[]{9, 3}));
          //
          
          //TEST CASE 81
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{6, 2},  new int[]{9, 3},new int[]{2, 1}, new int[]{9, 4}));
          //
          
           //TEST CASE 82
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{2, 1},  new int[]{7, 4},new int[]{5, 2}, new int[]{9, 3}));
          //
          
              //TEST CASE 83
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{5, 2}, new int[]{9, 3},new int[]{2, 1},  new int[]{7, 4}));
          //
          
          //TEST CASE 87  (PASS)
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{3, 1},  new int[]{9, 6},new int[]{4, 2}, new int[]{10, 6}));
          
          //TEST CASE 88 (PASS)
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{4, 2}, new int[]{10, 6},new int[]{3, 1},  new int[]{9, 6}));
          
          
          //TEST CASE 89
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-5, 1}, new int[]{1, 6},new int[]{-2, 3},  new int[]{0, 6}));
          
         //TEST CASE 90
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-2, 3},  new int[]{0, 6},new int[]{-5, 1}, new int[]{1, 6}));
          
          
           //TEST CASE 91
           //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-5, -7},  new int[]{1, -2},new int[]{-2, -5}, new int[]{0, -2}));
    }
}