public int solution(int K, int L, int M, int N, int P, int Q, int R, int S) {
         Point leftBottom = new Point(K,L);
         Point rightTop = new Point(M,N);
    	 Rectangle rec1 = new Rectangle(leftBottom,rightTop);
    	
    	 leftBottom = new Point(P,Q);
    	 rightTop = new Point(R,S);
    	 Rectangle rec2 = new Rectangle(leftBottom, rightTop);
    	
    	
		 int left = Math.max(rec1.leftBottom.x, rec2.leftBottom.x);
		 int right = Math.min(rec1.rightTop.x,rec2.rightTop.x);
		 int bottom = Math.max(rec1.leftBottom.y, rec2.leftBottom.y);
		 int top = Math.min(rec1.rightTop.y,rec2.rightTop.y);
		 
		 boolean intersect;
		 
		 if (left < right && bottom < top) {
			 intersect = true;
		 } else {
			 intersect = false;
		 }
		 
    	 long area = 0;
    	 if (intersect) {
    		 return rec1.getArea() + rec2.getArea() - (right - left)*(top - bottom);
    	 }else {
    			 area = rec1.getArea() + rec2.getArea();
    	 }
		 
		 if (area > Integer.MAX_VALUE) {
			 return -1;
		 }
		return (int)area;
    }