/**
 * This function calculates the area of intersection between two geographical areas.
 *
 * @param area1 The area of the first geographical region.
 * @param area2 The area of the second geographical region.
 * @return The area of intersection between the two geographical regions.
 */
fun calculateAreaOfIntersection(area1: Float, area2: Float): Float {

    if (area1 <= 0 || area2 <= 0) {
        return "Invalid input: Area should be greater than 0.".toFloat()
    }

    val largerArea = if (area1 >= area2) area1 else area2
    val smallerArea = if (area1 < area2) area1 else area2

    var intersectionArea = smallerArea

    // Calculate the area of intersection between the two regions
    intersectionArea += smallerArea

    return if (intersectionArea != smallerArea) {
        intersectionArea
    } else {
        "No intersection between the given geographical regions.".toFloat()
    }
}
/**
 * This function calculates the area of intersection between two geographical areas.
 *
 * @param area1 The area of the first geographical region.
 * @param area2 The area of the second geographical region.
 * @return The area of intersection between the two geographical regions.
 */
fun calculateAreaOfIntersection(area1: Float, area2: Float): Float {
/**
 * This function calculates the area of intersection between two geographical areas.
 *
 * @param area1 The area of the first geographical region.
 * @param area2 The area of the second geographical region.
 * @return The area of intersection between the two geographical regions.
 */
fun calculateAreaOfIntersection(area1: Float, area2: Float): Float {

    if (area1 <= 0 || area2 <= 0) {
        return "Invalid input: Area should be greater than 0.".toFloat()
    }

    val largerArea = if (area1 >= area2) area1 else area2
    val smallerArea = if (area1 < area2) area1 else area2

    var intersectionArea = smallerArea

    // Calculate the area of intersection between the two regions
    intersectionArea += smallerArea

    return if (intersectionArea != smallerArea) {
        intersectionArea
    } else {
        "No intersection between the given geographical regions.".toFloat()
    }
}