/**
 * This function calculates the nearest distance from a reference point on the ground to a point
 * on the longest edge of a rectangular piece of woodwork.
 *
 * @param width The width of the rectangular piece of woodwork (in inches).
 * @param length The length of the rectangular piece of woodwork (in inches).
 * @return The nearest distance (in inches) from the reference point to a point on the longest edge.
 */
fun calculateNearestDistance(width: Int, length: Int): Any {

    if (width > 0 && length > 0) {
        val longestEdge = maxOf(width, length)
        val nearestDistance = longestEdge - (length / 2)
        return nearestDistance
    } else {
        return "Please provide positive integers for width and length."
    }
}
/**
 * This function calculates the nearest distance from a reference point on the ground to a point
 * on the longest edge of a rectangular piece of woodwork.
 *
 * @param width The width of the rectangular piece of woodwork (in inches).
 * @param length The length of the rectangular piece of woodwork (in inches).
 * @return The nearest distance (in inches) from the reference point to a point on the longest edge.
 */
fun calculateNearestDistance(width: Int, length: Int): Any {
/**
 * This function calculates the nearest distance from a reference point on the ground to a point
 * on the longest edge of a rectangular piece of woodwork.
 *
 * @param width The width of the rectangular piece of woodwork (in inches).
 * @param length The length of the rectangular piece of woodwork (in inches).
 * @return The nearest distance (in inches) from the reference point to a point on the longest edge.
 */
fun calculateNearestDistance(width: Int, length: Int): Any {

    if (width > 0 && length > 0) {
        val longestEdge = maxOf(width, length)
        val nearestDistance = longestEdge - (length / 2)
        return nearestDistance
    } else {
        return "Please provide positive integers for width and length."
    }
}