import java.util.*;

//We need to handle this challenge from the perspective of understanding the shapes in the top right (positive x axis and y axis)
//I have a feeling that once this is established.
//I can then use  principles of test cases 1-7 in which I had completed the exact overlaps... In this area, I focussed on the
//implications of having coordinates in the positive x and negative x axis. I would need to apply the following logic
//if ((rect2BottomLeft[1]<0 && rect2TopRight[1]>0)) into my main analysis undertaken in the positive axis.
//Since the principles should still hold

//When it reaches test case 22 and 23, there are new challenges that have arisen


public class Solution 
{
    public static int overlappingArea(int[] rect1BottomLeft, int[] rect1TopRight, int[] rect2BottomLeft, int[] rect2TopRight) 
    {
        int width=0;
        int height=0;
        int [] store = new int[4];
        int count=0;
        boolean hasExactOverlap=false;
        
        
        if  ((rect1BottomLeft[0]) >= (rect1TopRight[0])  
        ||  (rect2BottomLeft[0]) >= (rect2TopRight[0]))
        {
            System.out.println("INVALID RECTANGLE CONFIGURATION");
            return 0;
        }
        
        
        //used for test case 11
        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;
           }
           
           
           if  (((rect1BottomLeft[0]) == (rect1TopRight[0]))  || 
                ((rect2BottomLeft[0]) == (rect2TopRight[0])) ||
                ((rect1BottomLeft[1]) == (rect1TopRight[1])) ||
                ((rect1BottomLeft[1]) == (rect1TopRight[1])))
                
                {
                    System.out.println("One or more squares are dimensionless.. No overlap/area calculation possible");

                    return 0;
                }
           
           //now need to focus on exact overlap
           
           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);
                  
                  }
                  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
           
           if (!hasExactOverlap)
           {
           if ((rect1BottomLeft[0]<0) && (rect1TopRight[0]>0)
        && (rect2BottomLeft[0]<0) && (rect2TopRight[0]>0))
        {
            System.out.println("1CHECKING OVERLAP 4 QUADRANTS");
            
                  if ((rect1BottomLeft[1]<0) && (rect1TopRight[1]>0)
                    && (rect2BottomLeft[1]<0) && (rect2TopRight[1]>0))
                    {
                        System.out.println("VIOLATION");
                        return 0;
                        
                    }
        }
           }
             
              
              //if all in the positive axis  or
              //need to check if any shapes cross an axis, since we know the calculation will
              //be impacted since we need to either add/subtract the width or height
              //effectively we need to check 
              //rectangle1 width crosses the x axis
              //rectangle1 height crosses the y axis
              //rectangle2 width crosses the x axis
              //rectangle2 height crosses the y axis
              
              
             /* 
             //all in positive quadrant
             if ((rect1BottomLeft[1]>=0 && rect2BottomLeft[1]>0  
             && rect1TopRight[1]>=0 && rect2TopRight[1]>=0)  
             
             || (rect1BottomLeft[0]<0 && rect1TopRight[0]>0)  //rectangle1 width crosses the x axis
             || (rect1BottomLeft[1]<0 && rect1TopRight[1]>0)  //rectangle1 height crosses the y axis
              || (rect2BottomLeft[0]<0 && rect2TopRight[0]>0)  //rectangle2 width crosses the x axis
             || (rect2BottomLeft[1]<0 && rect2TopRight[1]>0))  //rectangle2 height crosses the y axis
             */
             
             /*
              if ((rect1BottomLeft[1]>=0 && rect2BottomLeft[1]>0  
             && rect1TopRight[1]>=0 && rect2TopRight[1]>=0))  
             */
             
             //{
             
                   
                    //whether the shapes are physically overlapped
                    //looks at x axis
                    
                    //x axis smalller
                    if(rect1BottomLeft[0]<rect2BottomLeft[0])
                    {
                        //looks at y axis,  y axis smaller
                        if (rect1TopRight[1]<rect2TopRight[1])
                        {
                            
                            
    //We need something to treat different if X axis is smaller rect1BottomLeft[0]
    //(which blue is smaller than red rect1BottomLeft[0])...And also Y axis is smaller 
    //rect1TopRight[1](which it is, blue smaller than red rect1TopRight[2])..
    //This observation would be suitable for Test Case 8.
    //But for Test Case 22 and 23, we can also see that blue rectangle has gone through both sides of the red.....
    //To translate this into coding, we need to check if the blue rectangle has a top right (x axis) which is greater than red rectangle x axis...
    //IF this is the case, then we are interested in using the width = width of the red rectangle.
    //And we will need height to be the same as blue rectangle...
    
    if (rect1TopRight[0]>rect2TopRight[0])
    {
        //I am in this section due to Test case 58 and 59
        //we see the following
        //rect2=red
        //if(rect1BottomLeft[0]<rect2BottomLeft[0])  //X coordinate of blue rectangle bottom left is bigger
        //if (rect1TopRight[1]<rect2TopRight[1])  //Y coordinate of red rectangle top right is larger
        
        //Again there is no reference to spanning Y axis. This is created as below
        
        if ((rect1BottomLeft[0]<0) && (rect1TopRight[0]>0)
        && (rect2BottomLeft[0]<0) && (rect2TopRight[0]>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);
            System.out.println("MUST39");
        }
        
        else
        {
        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("HERE9");
        System.out.println(width);
        System.out.println(height);
        }
        
        return (Math.abs(width) * Math.abs(height));
    }
    
    else
    {
        //This will be new code here to ascertain if a rectangle appears on both sides of the Y axis.
        //Based on the above statement, we know that rectangle1 top right coordinate is less than rect2 top right
        //we will know check if rect2 runs on both sides of the Y axis
        //At moment, we do not know implications if both rectangles cross the Y axis.. But it is ignored at this moment in time
        //This is in reference to test case 38 and 39
        if (rect2BottomLeft[0]<0 && rect2TopRight[0]>0)
        {
            //This is in regarding test case 56 and 57
            //it does not appear that any form of reference has been made above in relation to both shapes spanning Y axis
            //the only areas of outer if loops include:
            
             //if(rect1BottomLeft[0]<rect2BottomLeft[0])   //X cordinate larger on rectangle 2 (bottom left)
             //if (rect1TopRight[1]<rect2TopRight[1])     //Y cordinate larger on rectangle 2 (top right)
            //rect2 = red
            //rect1=blue
            
            //X coordinate on top right of rectangle2 (red) is larger than blue
            //We also know that red top right is larger than blue top right
           
            //this now tackles both rectangles span across the Y axis (test case 56 and 57)
            if ((rect1BottomLeft[0]<0) && (rect1TopRight[0]>0)
                && (rect2BottomLeft[0]<0) && (rect2TopRight[0]>0))
            {
                //note addition
                width = Math.abs(0-rect2BottomLeft[0]) + Math.abs(0-rect1TopRight[0]);
                System.out.println(width);
                height = Math.abs(0-rect1TopRight[1]) - Math.abs(0-rect2BottomLeft[1]);
                System.out.println(height);
                 System.out.println("MUST37");
                
            }
           else
           {
            width = Math.abs(0-rect2BottomLeft[0]) - Math.abs(0-rect1TopRight[0]);
            System.out.println(width);
            height = Math.abs(0-rect2TopRight[1]) - Math.abs(0-rect1BottomLeft[1]);
            System.out.println(width);
             System.out.println("MUST15");
           }
        }
        
        //in this else area, we know that rectangle does not cross the Y axis
        //we know in this area. we know the the blue rectangle is rectangle1.....
        //We also know that following statement is not true....  rect1TopRight[0]>rect2TopRight[0])
        //top right X coordinate of the blue rectangle1 is 8
        //top right X coordinate of the red rectangle 2 is also 8
        //but in else statement, we need to consider if both are the same....
        //in which case the area can be calculated different..
        //This is in relation to Test Case 23new1 
        
        else
        {
            if (rect1TopRight[0]==rect2TopRight[0])
            {
                //red is rectangle2
                width = Math.abs(0-rect2BottomLeft[0]) - Math.abs(0-rect2TopRight[0]);
                System.out.println(width);
                height = Math.abs(0-rect1TopRight[1]) - Math.abs(0-rect1BottomLeft[1]);
                System.out.println(width);
                System.out.println("MUST51");
            }
            
            else
            {
            System.out.println("HERE1");
            width = Math.abs(0-rect2BottomLeft[0]) - Math.abs(0-rect1TopRight[0]);
            System.out.println(width);
            height = Math.abs(0-rect2BottomLeft[1]) - Math.abs(0-rect1TopRight[1]);
            System.out.println(height);
            }
        }
                            
            return (Math.abs(width) * Math.abs(height));
    }
                        }
                    }
                    
                    //Same code as above, but flipped  (test case 9)-----------------------------------------------------------
                    
                    if(rect2BottomLeft[0]<rect1BottomLeft[0])
                    {
                        if (rect2TopRight[1]<rect1TopRight[1])
                        {
                            
                            //We need something to treat different if X axis is smaller rect1BottomLeft[0]
    //(which blue is smaller than red rect1BottomLeft[0])...And also Y axis is smaller 
    //rect1TopRight[1](which it is, blue smaller than red rect1TopRight[2])..
    //This observation would be suitable for Test Case 8.
    //But for Test Case 22 and 23, we can also see that blue rectangle has gone through both sides of the red.....
    //To translate this into coding, we need to check if the blue rectangle has a top right (x axis) which is greater than red rectangle x axis...
    //IF this is the case, then we are interested in using the width = width of the red rectangle.
    //And we will need height to be the same as blue rectangle...
    
    if (rect2TopRight[0]>rect1TopRight[0])
    {
        width = Math.abs(0-rect1BottomLeft[0]) - Math.abs(0-rect1TopRight[0]);
        height = Math.abs(0-rect2BottomLeft[1]) - Math.abs(0-rect2TopRight[1]);
        
        if ((rect2BottomLeft[0]<0) && (rect2TopRight[0]>0)
        && (rect1BottomLeft[0]<0) && (rect1TopRight[0]>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);
            System.out.println("MUST40");
        }
        
        else
        {
        System.out.println("HERE10");
        System.out.println(width);
        System.out.println(height);
        }
        
        return (Math.abs(width) * Math.abs(height));
    }
                            
                            
                            
                            else
                            {
                                
                                //This will be new code here to ascertain if a rectangle appears on both sides of the Y axis.
        //Based on the above statement, we know that rectangle1 top right coordinate is less than rect2 top right
        //we will know check if rect2 runs on both sides of the Y axis
        //At moment, we do not know implications if both rectangles cross the Y axis.. But it is ignored at this moment in time
        //This is in reference to test case 38 and 39
        if (rect1BottomLeft[0]<0 && rect1TopRight[0]>0)
        {
            
            //This is in regarding test case 56 and 57
            //it does not appear that any form of reference has been made above in relation to both shapes spanning Y axis
            //the only areas of outer if loops include:
            
             //if(rect1BottomLeft[0]<rect2BottomLeft[0])   //X cordinate larger on rectangle 2 (bottom left)
             //if (rect1TopRight[1]<rect2TopRight[1])     //Y cordinate larger on rectangle 2 (top right)
            //rect2 = red
            //rect1=blue
            
            //X coordinate on top right of rectangle2 (red) is larger than blue
            //We also know that red top right is larger than blue top right
           
            //this now tackles both rectangles span across the Y axis (test case 56 and 57)
            if ((rect2BottomLeft[0]<0) && (rect2TopRight[0]>0)
                && (rect1BottomLeft[0]<0) && (rect1TopRight[0]>0))
            {
                //note addition
                width = Math.abs(0-rect1BottomLeft[0]) + Math.abs(0-rect2TopRight[0]);
                System.out.println(width);
                height = Math.abs(0-rect2TopRight[1]) - Math.abs(0-rect1BottomLeft[1]);
                System.out.println(height);
                 System.out.println("MUST38");
            }
            
            else
            {
            width = Math.abs(0-rect1BottomLeft[0]) - Math.abs(0-rect2TopRight[0]);
            System.out.println(width);
            height = Math.abs(0-rect1TopRight[1]) - Math.abs(0-rect2BottomLeft[1]);
            System.out.println(width);
             System.out.println("MUST16");
            }
        }
        
        
        
        
        
            
        
        
        
        
        
        
                 //in this else area, we know that rectangle does not cross the Y axis
        //we know in this area. we know the the blue rectangle is rectangle1.....
        //We also know that following statement is not true....  rect1TopRight[0]>rect2TopRight[0])
        //top right X coordinate of the blue rectangle1 is 8
        //top right X coordinate of the red rectangle 2 is also 8
        //but in else statement, we need to consider if both are the same....
        //in which case the area can be calculated different..
        //This is in relation to Test Case 23new1 
        
        
        
        
                                else
                                {
                                    
            if (rect2TopRight[0]==rect1TopRight[0])
            {
                //red is rectangle2
                width = Math.abs(0-rect1BottomLeft[0]) - Math.abs(0-rect1TopRight[0]);
                System.out.println(width);
                height = Math.abs(0-rect2TopRight[1]) - Math.abs(0-rect2BottomLeft[1]);
                System.out.println(width);
                System.out.println("MUST52");
            }
            
            else
            {
                System.out.println("HERE2");
                width = Math.abs(0-rect1BottomLeft[0]) - Math.abs(0-rect2TopRight[0]);
                System.out.println(width);
                height = Math.abs(0-rect1BottomLeft[1]) - Math.abs(0-rect2TopRight[1]);
                System.out.println(height);
            }
                                }
                            
                            return (Math.abs(width) * Math.abs(height));
                            }
                        }
                    }
                    
                    
                    //whether shape is inside shape 
                    //to make it compliant with test case 14 and test case 15, I included less than and equal to as part of equality check 
                    
                     if(rect1BottomLeft[0]>=rect2BottomLeft[0]  ||  rect2BottomLeft[0]>=rect1BottomLeft[0])
                     {
                        //test case 10
                        if (rect1TopRight[1]<=rect2TopRight[1])
                        {
                            //needed this as part of test cases 14 and 15
                            //to exactly identify which is inside the other one 
                            
                            //with test case 24 and test case 25 it is performning assumption that shape is inside shape
                            //we can understand from the perspective of the X coordinates, it fits inside
                            //But we have not contemplated the Y coordinate
                            
                            
                            if (rect1BottomLeft[1] >= rect2BottomLeft[1])
                            {
                            if(rect1BottomLeft[0]>=rect2BottomLeft[0])
                            {
                            
                            //we are here because of issues in test case 22new2 and 23new2
                            //at this point we know that rectangle 1 is blue,   rectangle 2 is red
                            
                            //overlappingArea(new int[]{4, 2}, new int[]{8, 4},new int[]{4, 0},  new int[]{5, 6}));
                            
                            //we know the blue has a higher or equal  Y coordinate than red triangle
                            //we also know that blue has a higher or equal  X coordinate than red triangle
                            //but really we are concerned with a different calculation if the x coordinates of the two rectangles are the same
                            
                            //rect2=red
                            
                            if (rect1BottomLeft[0]==rect2BottomLeft[0])
                            {
                                if (rect1TopRight[1]<=rect2TopRight[1])
                                {
                                width = Math.abs(0-rect1BottomLeft[0]) - Math.abs(0-rect1TopRight[0]);
                                System.out.println(width);
                                }
                                else
                                {
                                    width = Math.abs(0-rect2BottomLeft[0]) - Math.abs(0-rect2TopRight[0]);
                                System.out.println(width);
                                    
                                }
                                
                                //CHANGE HERE
                                height = Math.abs(0-rect1BottomLeft[1]) - Math.abs(0-rect1TopRight[1]);
                                System.out.println(height);
                                System.out.println("MUST29");
                                store[count]=(Math.abs(width) * Math.abs(height));
                                count++;
                            }
                            else
                            {
                                
                                //We are here because of test case 52.  Blue is rectangle1 
                                //overlappingArea(new int[]{-4, -6}, new int[]{4, -3},new int[]{-2, -5},  new int[]{5, -4}))
                                //It is important to understand what we know so far.....
                                //We know the X coordinates of the bottom left of the rectangles are not the same....
                                //but we know that the rectangle botton left coordinate of rectangle2 (red) is greater than blue
                                //we also know that Y coordinate (top right) of blue rectangle is greater than equal to red..
                                //we are also here because
                                //x coordinate of blue rectangle(rect2) (bottom left ) is greater than or equal to red(rect1)
                                //OR
                                //x coordinate of red rectangle(rect1) (bottom left ) is greater than or equal to blue(rect2)
                                //In this area of code, we have not touched upon the shapes spanning the Y axis
                                //AND MOST IMPORTANTLY THE OVERLAP SPANNING ACROSS THE Y AXIS
                                
                                //I will get the if expression from above and re-use it here with caution (both rectangles spanning across Y axis)
                                
                                  if ((rect2BottomLeft[0]<0) && (rect2TopRight[0]>0)
                                && (rect1BottomLeft[0]<0) && (rect1TopRight[0]>0))
                                {
                                    //note addition of the width
                                    //rect1 = red
                                    width = Math.abs(0-rect2TopRight[0]) + Math.abs(0-rect1BottomLeft[0]);
                                    System.out.println(width);
                                    //note since the shape has not crossed height wise across the X axis,
                                    //we are not changing this....
                                    //but it will potentially become an issue when I further devise test cases
                                    //in which overlap is on both side of the X axis 
                                    height = Math.abs(0-rect1BottomLeft[1]) - Math.abs(0-rect1TopRight[1]);
                                    System.out.println(height);
                                    System.out.println("MUST34");
                                     store[count]=(Math.abs(width) * Math.abs(height));
                                    count++;
                                }
                                
                                else
                                {
                                    //in here due to test case 82 and 83
                       //the associated if is due to there being rectangles across the Y axis
                           //this is clearly not the case, yet the logic seems to be lacking massively....
                         //it needs spliting into if else
             //we know following at this point:   both rectangles have different X coordinate for bottom left
                                    //rect2bottomleft X coordinate is greater than or equal  rect1bottomleft (red) 
                                    //rect1topright (red) Y coordinate is greater equal to  rect2TopRight
                                    
                                    //there is every possibility that is requires the exact same code as
                                    
                                    //red = rect2
                                    
                                    if (rect2TopRight[0]>rect1TopRight[0])
                                    {
                                        System.out.println("MUST60");
                                        width = Math.abs(0-rect1BottomLeft[0]) - Math.abs(0-rect1TopRight[0]);
                                        System.out.println(width);
                                        height = Math.abs(0-rect1BottomLeft[1]) - Math.abs(0-rect1TopRight[1]);
                                         System.out.println(height);
                                         store[count]=(Math.abs(width) * Math.abs(height));
                                         count++;
                                    }
                            //this would be shapes not spanning Y axis
                            //it has used the property of one shape..
                            //this is potentially my first bits of code since it assumes that rect1 and rect2 shares the same X coordinate...
                            //it would be false under any other circumstance.. But I am leaving it intact...
                                    
                            
                            if (rect2TopRight[0]==rect1TopRight[0])

                            {
                            System.out.println("MUST1");
                            width = Math.abs(0-rect1BottomLeft[0]) - Math.abs(0-rect1TopRight[0]);
                            System.out.println(width);
                            height = Math.abs(0-rect1BottomLeft[1]) - Math.abs(0-rect1TopRight[1]);
                            System.out.println(height);
                            
                            store[count]=(Math.abs(width) * Math.abs(height));
                            count++;
                            }
                            
                            else
                                {
                                    System.out.println("MUST62");
                                    width = Math.abs(0-rect1BottomLeft[0]) - Math.abs(0-rect2TopRight[0]);
                                    System.out.println(width);
                                    height = Math.abs(0-rect1BottomLeft[1]) - Math.abs(0-rect1TopRight[1]);
                                    System.out.println(height);
                                    store[count]=(Math.abs(width) * Math.abs(height));
                                    count++;
                                }
                            
                            
                            
                            
                            
                            
                            
                            
                            
                                }
                            }
                            //return (Math.abs(width) * Math.abs(height));
                            
                            }
                            
                            
                            else
                            {
                                
                            
                            System.out.println("MUST2");
                            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);
                            store[count]=(Math.abs(width) * Math.abs(height));
                            count++;
                            
                            }
                            
                        }
                        
                        //this is taking into consideration of the Y co-ordinates and making a better decision in test case 24 and 25
                        
                        //we are in this section because Y coordinate of rect1BottomLeft is not greater than or equal to rect2BottomLeft
                        //This is trying to resolve Test Case 14new and 15new
                        //blue is rectangle1
                        //if (rect1BottomLeft[1] >= rect2BottomLeft[1])
                        
                        else
                        {
                            //this now tackles test cases 48 and 49 where both rectangles span across the Y axis
                            if ((rect1BottomLeft[0]<0) && (rect1TopRight[0]>0)
                                && (rect2BottomLeft[0]<0) && (rect2TopRight[0]>0))
                            {
                                //in cases such as test case 14new and test case 15 new we still have where the 
                                //x coordinates are same for rect2TopRight for both rectangles...
                                //this has to be handled separately in comparison to having two rectangles spanning across the Y axis
                                //(test case 48 and 49) where the rectTopRight are not same for both rectangles 
                                //overlappingArea(new int[]{-5, 1},  new int[]{1, 6},new int[]{-2, 3}, new int[]{1, 6}));
                                //blue is rectangle1
                                
                                //if they share same x coordinate
                                 if (rect1TopRight[0]==rect2TopRight[0])
                                {
                                    //we also need to add width as oppose to subtract
                                    width = Math.abs(0-rect2BottomLeft[0]) + Math.abs(0-rect1TopRight[0]);
                                    System.out.println(width);
                                    height = Math.abs(0-rect2BottomLeft[1]) - Math.abs(0-rect1TopRight[1]);
                                    System.out.println(height);
                               System.out.println("MUST31");
                                }
                                
                                else
                                {
                                    //we are here due to test cases 54 and 55
                                    //rect1 = red
                                    //we know that top right do not share same x coordinates for the rectangles
                                    //we know both rectangles span across Y axis
                                    //We know that Y coordinate of blue bottom left is greater than red bottom left
                                    //we know that it is not a shape within a shape
                                    //But it appears there needs to be reference to top right of both rectangles being on the same 
                                    //Y coordinate
                                    //So this naturally leads me towards issue that might arise if the botom left of the rectangles share
                                    //same X coordinate (this will be potentially test cases 56 and 57)
                                    
                                    if (rect1TopRight[1]==rect2TopRight[1])
                                    {
                                        
                                        //again we need to add due to crossing the Y axis
                                        
                                        //in this area due to test case 66 and 67..
                                        //this is already in an area of code that considers spanning Y axis both rectangles.
                                        //so what makes this scenario different to Test case 55 which passes through this area
                                        //we know they both have the same Y coordinate for the top right of the rectangle
                                        //rect1=blue
                                        
                                        
                                        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]);
                                            }
                                            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("MUST42");
                                            }
                                                
                                        }
                                        /*
                                        else
                                        {
                                        
                                        //again we need to add due to crossing the Y axis
                                        width = Math.abs(0-rect1BottomLeft[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("MUST35");
                                        }
                                        */
                                    }
                                    else
                                    {
                                        System.out.println("IN THIS SECTION2");
                                        
                                        //we are here due to test cases 72 and 73
                                        //we can see it is else statement since the top right X coordinates of rectangles are different..
                                        //but we know that all other principles hold the same as above....
                                        //so it is a case of copying the above code here...
                                        //but issue is here that once we do that, we need to copy the equivalent else statement
                                        //from the rectangle rotation as part of this code also......
                                        
                                        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]);
                                            }
                                            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("MUST42");
                                            }
                                        }
                                        
                                        if (rect1TopRight[0]>=rect2TopRight[0])
                                        {
                                            //we are here because of test case 70 and 71
                                            //
                                            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]);
                                            }
                                            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");
                                            }
                                        }
                                        
                                        
                                        
                                        
                                        //I am also unsure about the purpose of this code
                                        //but I will leave it commented out just incase
                               
                               /*     
                               width = Math.abs(0-rect2BottomLeft[0]) - Math.abs(0-rect1TopRight[0]);
                               System.out.println(width);
                               height = Math.abs(0-rect1BottomLeft[1]) - Math.abs(0-rect2TopRight[1]);
                               System.out.println(height);
                               System.out.println("MUST20");
                               */
                               
                                    }
                                }
                            }
                            
                            else
                            {
                                
                            //when examining test case 14 and test case 15, we are getting incorect width of the larger rectangle.
                            //instead we need the width and height of the nested rectangle
                            //I can only speculate that I need to reference if the rectXBottom (X,Y) coincides with both rectangles  
                            //or the rectXTopRight (X,Y) coincides with both rectangles..  
                            //We would then to calculate the overlap area to be the nested rectangle…
                            //I also believe we are in area of code where its confirmed if it nested, so just interested if either top right or bottom left pair up
                            //But right now, it just does not seem so obvious if it will make right decision on with rectangle to process.
                            //But if I do same for both scenarios, this should suffice
                            //In practice this seems very inconsistent with associated if...
                            
        //if (rect1TopRight[0]==rect2TopRight[0]  && rect1TopRight[1]==rect2TopRight[1])
        //We now check if the x coordinate (bottom left) of rectangle1 is bigger or smaller than rectangle 2  (if rect1BottomLeft[0]>rect2BottomLeft[0])
//If bigger     width =   Math.abs(rect1BottomLeft[0])  - Math.abs(rect2TopRight[0])      height =  Math.abs(rect1BottomLeft[1])  - Math.abs(rect2TopRight[1])
//else             width =   Math.abs(rect2BottomLeft[0])  - Math.abs(rect1TopRight[0])      height =  Math.abs(rect2BottomLeft[1])  - Math.abs(rect1TopRight[1])
                            
                            
                             
                            if (rect1TopRight[0]==rect2TopRight[0]  && rect1TopRight[1]==rect2TopRight[1])
                            {
                                System.out.println("MUST26");
            //We now check if the x coordinate (bottom left) of rectangle1 is bigger or smaller than rectangle 2  
                            
                            if (rect1BottomLeft[0]>rect2BottomLeft[0])
                            {
                                System.out.println("MUST27");
                                width =   Math.abs(rect1BottomLeft[0])  - Math.abs(rect1TopRight[0]);      
                                height =  Math.abs(rect1BottomLeft[1])  - Math.abs(rect1TopRight[1]);
                            }
                            else 
                            {
                                System.out.println("MUST28");
                                width=Math.abs(rect2BottomLeft[0])  - Math.abs(rect2TopRight[0]);      
                                height =  Math.abs(rect2BottomLeft[1])  - Math.abs(rect2TopRight[1]);
                            }
                      
                            }
                            
                            /*
                            //........................................
                            if (rect1TopRight[0]==rect2TopRight[0]  && rect1TopRight[1]==rect2TopRight[1])
                            {
            //We now check if the x coordinate (bottom left) of rectangle1 is bigger or smaller than rectangle 2  
                            
                            if (rect1BottomLeft[0]>rect2BottomLeft[0])
                            {
                                width =   Math.abs(rect1BottomLeft[0])  - Math.abs(rect1TopRight[0])      
                                height =  Math.abs(rect1BottomLeft[1])  - Math.abs(rect1TopRight[1])
                            }
                            else 
                            {
                                width=Math.abs(rect2BottomLeft[0])  - Math.abs(rect2TopRight[0]);      
                                height =  Math.abs(rect2BottomLeft[1])  - Math.abs(rect2TopRight[1]);
                            }
                      
                            }
                            //..................................................................
                            */
                            
                            
                            
                                
                            //width = Math.abs(0-rect2BottomLeft[0]) - Math.abs(0-rect1TopRight[0]);
                            
                            //rect1=red
                            //we know this is not the case
                            //if (rect1TopRight[0]==rect2TopRight[0]  && rect1TopRight[1]==rect2TopRight[1])
                            
                            else
                            {
                                //rect2=blue
                                if (rect1BottomLeft[0]<rect2BottomLeft[0])
                                {
                                    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("MUST7a");
                                    
                                }
                                else
                                {
                                    //rect2=blue
                                    width = Math.abs(0-rect2BottomLeft[0]) - Math.abs(0-rect1TopRight[0]);
                            System.out.println(width);
                            height = Math.abs(0-rect2BottomLeft[1]) - Math.abs(0-rect1TopRight[1]);
                            System.out.println(height);
                            System.out.println("MUST7");
                                    
                                }
                                
                            //width = Math.abs(0-rect1BottomLeft[0]) - Math.abs(0-rect2TopRight[0]);
                            //System.out.println(width);
                            //height = Math.abs(0-rect2BottomLeft[1]) - Math.abs(0-rect1TopRight[1]);
                            //System.out.println(height);
                            
                            }
                                
                                
                            }
                            
                            System.out.println("test");
                            return (Math.abs(width) * Math.abs(height));
                        }
                        
                        
                     }
                        
                        //test case 11
                        //swap of shapes
                        
                        if (rect2TopRight[1]<=rect1TopRight[1])
                        {
                            //needed this as part of test cases 14 and 15
                            //to exactly identify which is inside the other one 
                            
                            //needed this as part of test cases 14 and 15
                            //to exactly identify which is inside the other one 
                            
                            //with test case 24 and test case 25 it is performning assumption that shape is inside shape
                            //we can understand from the perspective of the X coordinates, it fits inside
                            //But we have not contemplated the Y coordinate
                            
                            
                            if (rect2BottomLeft[1] >= rect1BottomLeft[1])
                            {
                            
                            
                            if (rect2BottomLeft[0]>=rect1BottomLeft[0])
                            {
                                //we are here because of issues in test case 22new2 and 23new2
                            //at this point we know that rectangle 1 is blue,   rectangle 2 is red
                            
                            //overlappingArea(new int[]{4, 2}, new int[]{8, 4},new int[]{4, 0},  new int[]{5, 6}));
                            
                            //we know the blue has a higher or equal  Y coordinate than red triangle
                            //we also know that blue has a higher or equal  X coordinate than red triangle
                            //but really we are concerned with a different calculation if the x coordinates of the two rectangles are the same
                            
                            if (rect2BottomLeft[0]==rect1BottomLeft[0])
                            {
                                
                                 if (rect2TopRight[1]<=rect1TopRight[1])
                                {
                                width = Math.abs(0-rect2BottomLeft[0]) - Math.abs(0-rect2TopRight[0]);
                                System.out.println(width);
                                }
                                else
                                {
                                    width = Math.abs(0-rect1BottomLeft[0]) - Math.abs(0-rect1TopRight[0]);
                                System.out.println(width);
                                    
                                }
                                
                                //CHANGE HERE
                                
                                //if (rect2TopRight[1]<rect1TopRight[1])
                                //{
                                    
                                //}
                                
                                //width = Math.abs(0-rect1BottomLeft[0]) - Math.abs(0-rect1TopRight[0]);
                                //System.out.println(width);
                                height = Math.abs(0-rect2BottomLeft[1]) - Math.abs(0-rect2TopRight[1]);
                                System.out.println(height);
                                System.out.println("MUST30");
                                store[count]=(Math.abs(width) * Math.abs(height));
                                count++;
                            }
                            else
                            {
                                //We are here because of test case 52.  Blue is rectangle1 
                                //overlappingArea(new int[]{-4, -6}, new int[]{4, -3},new int[]{-2, -5},  new int[]{5, -4}))
                                //It is important to understand what we know so far.....
                                //We know the X coordinates of the bottom left of the rectangles are not the same....
                                //but we know that the rectangle botton left coordinate of rectangle2 (red) is greater than blue
                                //we also know that Y coordinate (top right) of blue rectangle is greater than equal to red..
                                //we are also here because
                                //x coordinate of blue rectangle(rect2) (bottom left ) is greater than or equal to red(rect1)
                                //OR
                                //x coordinate of red rectangle(rect1) (bottom left ) is greater than or equal to blue(rect2)
                                //In this area of code, we have not touched upon the shapes spanning the Y axis
                                //AND MOST IMPORTANTLY THE OVERLAP SPANNING ACROSS THE Y AXIS
                                
                                //I will get the if expression from above and re-use it here with caution (both rectangles spanning across Y axis)
                                
                                 if ((rect1BottomLeft[0]<0) && (rect1TopRight[0]>0)
                                && (rect2BottomLeft[0]<0) && (rect2TopRight[0]>0))
                                {
                                    //note addition of the width
                                    //rect1 = blue
                                    width = Math.abs(0-rect1TopRight[0]) + Math.abs(0-rect2BottomLeft[0]);
                                    System.out.println(width);
                                    //note since the shape has not crossed height wise across the X axis,
                                    //we are not changing this....
                                    //but it will potentially become an issue when I further devise test cases
                                    //in which overlap is on both side of the X axis 
                                    height = Math.abs(0-rect2BottomLeft[1]) - Math.abs(0-rect2TopRight[1]);
                                    System.out.println(height);
                                    System.out.println("MUST33");
                                     store[count]=(Math.abs(width) * Math.abs(height));
                                    count++;
                                }
                                
                                else
                                {
                                    //in here due to test case 82 and 83
                                    //the associated if is due to there being rectangles across the Y axis
                                    //this is clearly not the case, yet the logic seems to be lacking massively....
                                    //it needs spliting into if else
                                    //we know following at this point:   both rectangles have different X coordinate for bottom left
                                    //rect2bottomleft X coordinate is greater than or equal  rect1bottomleft (red) 
                                    //rect1topright (red) Y coordinate is greater equal to  rect2TopRight
                                    
                                    //there is every possibility that is requires the exact same code as
                                    
                                    //red = rect2
                                    
                                    if (rect1TopRight[0]>rect2TopRight[0])
                                    {
                                        System.out.println("MUST60");
                                        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);
                                         store[count]=(Math.abs(width) * Math.abs(height));
                                        count++;
                                         
                                         
                                    }
                                    
                            //this would be shapes not spanning Y axis
                            //it has used the property of one shape..
                            //this is potentially my first bits of code since it assumes that rect1 and rect2 shares the same X coordinate...
                            //it would be false under any other circumstance.. But I am leaving it intact...
                            else
                            {
                                if (rect1TopRight[0]==rect2TopRight[0])
                                {
                            System.out.println("MUST3");
                            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);
                            //return (Math.abs(width) * Math.abs(height));
                            store[count]=(Math.abs(width) * Math.abs(height));
                            count++;
                                }
                                else
                                {
                                    System.out.println("MUST61");
                                    width = Math.abs(0-rect2BottomLeft[0]) - Math.abs(0-rect1TopRight[0]);
                                    System.out.println(width);
                                    height = Math.abs(0-rect2BottomLeft[1]) - Math.abs(0-rect2TopRight[1]);
                                    System.out.println(height);
                                    store[count]=(Math.abs(width) * Math.abs(height));
                                    count++;
                                }
                                
                                
                            }
                                }
                        }
                            }
                            
                            else
                            {
                                System.out.println("MUST4");
                            width = Math.abs(0-rect1BottomLeft[0]) - Math.abs(0-rect1TopRight[0]);
                            System.out.println(width);
                            height = Math.abs(0-rect1BottomLeft[1]) - Math.abs(0-rect1TopRight[1]);
                            System.out.println(height);
                             store[count]=(Math.abs(width) * Math.abs(height));
                            
                            }
                        }
                        
                        //this is taking into consideration of the Y co-ordinates and making a better decision in test case 24 and 25
                        //we are here because following is false...
                        
                        //if (rect2BottomLeft[1] >= rect1BottomLeft[1])
                        
                        else
                        {
                            
                            //this now tackles test cases 48 and 49 where both rectangles span across the Y axis
                            if ((rect2BottomLeft[0]<0) && (rect2TopRight[0]>0)
                                && (rect1BottomLeft[0]<0) && (rect1TopRight[0]>0))
                            {
                                
                                
                                //in cases such as test case 14new and test case 15 new we still have where the 
                                //x coordinates are same for rect2TopRight for both rectangles...
                                //this has to be handled separately in comparison to having two rectangles spanning across the Y axis
                                //(test case 48 and 49) where the rectTopRight are not same for both rectangles 
                                //overlappingArea(new int[]{-2, 3}, new int[]{1, 6},new int[]{-5, 1},  new int[]{1, 6}));
                                //red is rectangle1
                                
                                //if they share same x coordinate
                                 if (rect2TopRight[0]==rect1TopRight[0])
                                {
                                    //we also need to add width as oppose to subtract
                                    width = Math.abs(0-rect1BottomLeft[0]) + Math.abs(0-rect2TopRight[0]);
                                    System.out.println(width);
                                    height = Math.abs(0-rect1BottomLeft[1]) - Math.abs(0-rect2TopRight[1]);
                                    System.out.println(height);
                               System.out.println("MUST32");
                                }
                                
                                else
                                {
                                    
                                    //we are here due to test cases 54 and 55
                                    //rect2 = blue
                                    //we know that top right do not share same x coordinates for the rectangles
                                    //we know both rectangles span across Y axis
                                    //We know that Y coordinate of blue bottom left is greater than red bottom left
                                    //we know that it is not a shape within a shape
                                    //But it appears there needs to be reference to top right of both rectangles being on the same 
                                    //Y coordinate
                                    //So this naturally leads me towards issue that might arise if the botom left of the rectangles share
                                    //same X coordinate (this will be potentially test cases 56 and 57)
                                    
                                    if (rect2TopRight[1]==rect1TopRight[1])
                                    {
                                        //again we need to add due to crossing the Y axis
                                        
                                        //in this area due to test case 66 and 67..
                                        //this is already in an area of code that considers spanning Y axis both rectangles.
                                        //so what makes this scenario different to Test case 55 which passes through this area
                                        //we know they both have the same Y coordinate for the top right of the rectangle
                                        //rect1=blue
                                        
                                        
                                        if (rect1TopRight[0]>=rect2TopRight[0])
                                        {
                                            //we are here because of test case 70 and 71
                                            //
                                            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]);
                                            }
                                            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");
                                            }
                                                
                                        }
                                    }
                                    
                                    //DOES THIS NEED TO BE IMPROVED
                                    else
                                    {
                                        System.out.println("IN THIS SECTION1");
                                        
                                        //we are here due to test cases 72 and 73
                                        //we can see it is else statement since the top right X coordinates of rectangles are different..
                                        //but we know that all other principles hold the same as above....
                                        //so it is a case of copying the above code here...
                                        //but issue is here that once we do that, we need to copy the equivalent else statement
                                        //from the rectangle rotation as part of this code also......
                                        
                                        //I am also unsure about the purpose of this code
                                        //but I will leave it commented out just incase
                                        /*
                                        width = Math.abs(0-rect1BottomLeft[0]) - Math.abs(0-rect2TopRight[0]);
                                        System.out.println(width);
                                        height = Math.abs(0-rect2BottomLeft[1]) - Math.abs(0-rect1TopRight[1]);
                                        System.out.println(height);
                                        System.out.println("MUST21");
                                        */
                                        
                                        if (rect1TopRight[0]>=rect2TopRight[0])
                                        {
                                            //we are here because of test case 70 and 71
                                            //
                                            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]);
                                            }
                                            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");
                                            }
                                                
                                        }
                                        
                                        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]);
                                            }
                                            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("MUST42");
                                            }
                                                
                                        }
                                        
                                        
                                        
                                    }
                                    
                                    /*
                                    else
                                    {
                                    
                               width = Math.abs(0-rect1BottomLeft[0]) - Math.abs(0-rect2TopRight[0]);
                               System.out.println(width);
                               height = Math.abs(0-rect2BottomLeft[1]) - Math.abs(0-rect1TopRight[1]);
                               System.out.println(height);
                               System.out.println("MUST21");
                                    }
                                    */
                                }
                            }
                            
                            else
                            {
                                
                                //when examining test case 14 and test case 15, we are getting incorect width of the larger rectangle.
                            //instead we need the width and height of the nested rectangle
                            //I can only speculate that I need to reference if the rectXBottom (X,Y) coincides with both rectangles  
                            //or the rectXTopRight (X,Y) coincides with both rectangles..  
                            //We would then to calculate the overlap area to be the nested rectangle…
                            //I also believe we are in area of code where its confirmed if it nested, so just interested if either top right or bottom left pair up
                            //But right now, it just does not seem so obvious if it will make right decision on with rectangle to process.
                            //But if I do same for both scenarios, this should suffice
                            //In practice this seems very inconsistent with associated if...
                            
        //if (rect1TopRight[0]==rect2TopRight[0]  && rect1TopRight[1]==rect2TopRight[1])
        //We now check if the x coordinate (bottom left) of rectangle1 is bigger or smaller than rectangle 2  (if rect1BottomLeft[0]>rect2BottomLeft[0])
//If bigger     width =   Math.abs(rect1BottomLeft[0])  - Math.abs(rect2TopRight[0])      height =  Math.abs(rect1BottomLeft[1])  - Math.abs(rect2TopRight[1])
//else             width =   Math.abs(rect2BottomLeft[0])  - Math.abs(rect1TopRight[0])      height =  Math.abs(rect2BottomLeft[1])  - Math.abs(rect1TopRight[1])
                            
                            
                             
                            if (rect2TopRight[0]==rect1TopRight[0]  && rect2TopRight[1]==rect1TopRight[1])
                            {
            //We now check if the x coordinate (bottom left) of rectangle1 is bigger or smaller than rectangle 2  
                            
                            System.out.println("MUST23");
                            if (rect2BottomLeft[0]>rect1BottomLeft[0])
                            {
                                
                                
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{3, -1}, new int[]{9, 6},new int[]{6, -3},  new int[]{9, 6}));
        
                                
                                System.out.println("MUST24");
                                width =   Math.abs(rect2BottomLeft[0])  - Math.abs(rect2TopRight[0]);     
                                height =  Math.abs(rect2BottomLeft[1])  - Math.abs(rect2TopRight[1]);
                            }
                            else 
                            {
                                System.out.println("MUST25");
                                width=Math.abs(rect1BottomLeft[0])  - Math.abs(rect1TopRight[0]);      
                                height =  Math.abs(rect1BottomLeft[1])  - Math.abs(rect1TopRight[1]);
                            }
                      
                            }
                                
                            else
                            {
                                
                            if (rect2BottomLeft[0]>rect1BottomLeft[0])
                                {
                                    width = Math.abs(0-rect1BottomLeft[0]) - Math.abs(0-rect1TopRight[0]);
                            System.out.println(width);
                            height = Math.abs(0-rect1BottomLeft[1]) - Math.abs(0-rect1TopRight[1]);
                            System.out.println(height);
                            System.out.println("MUST8a");
                                    
                                }
                                else
                                {
                                    
                                   width = Math.abs(0-rect1BottomLeft[0]) - Math.abs(0-rect2TopRight[0]);
                            System.out.println(width);
                            height = Math.abs(0-rect1BottomLeft[1]) - Math.abs(0-rect2TopRight[1]);
                            
                            System.out.println(height);
                            System.out.println("MUST8");
                            store[count]=(Math.abs(width) * Math.abs(height));
                                    count++;
                                    return GetHighestArea(store);
                                }
                            
                            
                            
                            
                            
                            
                            }
                            
                            }
                            return (Math.abs(width) * Math.abs(height));
                        }
                            
                        }
                    }
                //}
                
                //Not all in the positive axis
                //else
                //{
                 //    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]);
                      
                //  }
                    
                //}
                
        
        //return (Math.abs(width) * Math.abs(height));
        return GetHighestArea(store);
    }
    
    public static int GetHighestArea(int []store)
    {
        System.out.println("**********************************************");
        int min = store[0];
        for (int i: store)
        {
            System.out.println("AREA: " + i);
            if (i<min && i!=0)
            {
                min = i;
            }
        }
        return min;
    }

    public static void main (String[] args)
    {
        
           //TEST CASE 1 - NO OVERLAP
          //System.out.println("The overlapping area is: " + overlappingArea(new int[]{-6, 5},  new int[]{-5, 5},new int[]{-8, 2}, new int[]{-4, 3}));
        //                                                           //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 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 50
           //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
           //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 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 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 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 87
          //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
          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}));
    }
}