/**
 * This function checks if two rectangular areas intersect with each other.
 *
 * @param length1 Length of the first rectangular area.
 * @param width1 Width of the first rectangular area.
 * @param length2 Length of the second rectangular area.
 * @param width2 Width of the second rectangular area.
 * @return A message indicating whether the two rectangular areas intersect or not.
 */
fun checkIntersection(length1: Float, width1: Float, length2: Float, width2: Float): String {

    // Check if the given lengths and widths are greater than zero
    if (length1 <= 0 || width1 <= 0 || length2 <= 0 || width2 <= 0) {
        return "Invalid input! Length and width should be positive values."
    }

    // Check if the two rectangular areas intersect
    if (length1 < length2) {
        if (width1 < width2) {
            return "The two rectangular areas do not intersect."
        } else {
            return "The two rectangular areas intersect."
        }
    } else {
        if (width1 < width2) {
            return "The two rectangular areas intersect."
        } else {
            return "The two rectangular areas do not intersect."
        }
    }
}
/**
 * This function checks if two rectangular areas intersect with each other.
 *
 * @param length1 Length of the first rectangular area.
 * @param width1 Width of the first rectangular area.
 * @param length2 Length of the second rectangular area.
 * @param width2 Width of the second rectangular area.
 * @return A message indicating whether the two rectangular areas intersect or not.
 */
fun checkIntersection(length1: Float, width1: Float, length2: Float, width2: Float): String {
/**
 * This function checks if two rectangular areas intersect with each other.
 *
 * @param length1 Length of the first rectangular area.
 * @param width1 Width of the first rectangular area.
 * @param length2 Length of the second rectangular area.
 * @param width2 Width of the second rectangular area.
 * @return A message indicating whether the two rectangular areas intersect or not.
 */
fun checkIntersection(length1: Float, width1: Float, length2: Float, width2: Float): String {

    // Check if the given lengths and widths are greater than zero
    if (length1 <= 0 || width1 <= 0 || length2 <= 0 || width2 <= 0) {
        return "Invalid input! Length and width should be positive values."
    }

    // Check if the two rectangular areas intersect
    if (length1 < length2) {
        if (width1 < width2) {
            return "The two rectangular areas do not intersect."
        } else {
            return "The two rectangular areas intersect."
        }
    } else {
        if (width1 < width2) {
            return "The two rectangular areas intersect."
        } else {
            return "The two rectangular areas do not intersect."
        }
    }
}