private static int areaWasted(Rectangle first, Rectangle second) {
		if (first.width > 0 && first.height > 0 && second.width > 0 && second.height > 0) {
			long combinedArea = (long) first.width * (long) first.height + (long) second.width * (long) second.height;
			Rectangle union = first.union(second);
			long unionArea = (long) union.height * (long) union.width;
			Rectangle overlap = first.intersection(second);
			long overlapArea = (long) overlap.height * (long) overlap.width;
			return (int) ((unionArea - (combinedArea - overlapArea)) * 100L / combinedArea);
		}
		return Integer.MAX_VALUE / 2;
	}