public int computeAreaPart(int top, int bottom, Box topBox, Box bottomBox, Box current) {
        int area = 0;
        if (top < MAX_VALUE && bottom < MAX_VALUE) {
            if (current.in(topBox) && current.in(bottomBox)) {
                area = -current.area();
            } else {
                int topLength = current.intersectionLength(topBox);
                int bottomLength = current.intersectionLength(bottomBox);
                if (topLength == bottomLength) {
                    area = -current.area();
                } else if (topLength > bottomLength) {
                    area = -(bottomLength * current.weight());
                    area += ((topLength - bottomLength) * topBox.weightDistance(current));
                } else {
                    area = -(topLength * current.weight());
                    area += ((bottomLength - topLength) * current.weightDistance(bottomBox));
                }
            }
        } else if (top < MAX_VALUE) {
            area = current.intersectionArea(topBox);
        } else if (bottom < MAX_VALUE) {
            area = current.intersectionArea(bottomBox);
        }
        return area;
    }