/**
 * This function calculates the number of days a social worker can take off in a month based on the number of rainy days.
 *
 * @param month The number of days in the month.
 * @param rainyDays The number of rainy days in the month.
 * @return The maximum number of days off the social worker can take.
 */
fun socialWorkerDaysOff(month: Int, rainyDays: Int): Int {

    var daysOff = 0
    var remainingMonth = month

    while (remainingMonth > 0) {
        when {
            rainyDays < remainingMonth / 2 -> daysOff++
            rainyDays == remainingMonth / 2 -> daysOff += 2
            else -> daysOff += 3
        }
        remainingMonth--
    }

    return daysOff
}
/**
 * This function calculates the number of days a social worker can take off in a month based on the number of rainy days.
 *
 * @param month The number of days in the month.
 * @param rainyDays The number of rainy days in the month.
 * @return The maximum number of days off the social worker can take.
 */
fun socialWorkerDaysOff(month: Int, rainyDays: Int): Int {
/**
 * This function calculates the number of days a social worker can take off in a month based on the number of rainy days.
 *
 * @param month The number of days in the month.
 * @param rainyDays The number of rainy days in the month.
 * @return The maximum number of days off the social worker can take.
 */
fun socialWorkerDaysOff(month: Int, rainyDays: Int): Int {

    var daysOff = 0
    var remainingMonth = month

    while (remainingMonth > 0) {
        when {
            rainyDays < remainingMonth / 2 -> daysOff++
            rainyDays == remainingMonth / 2 -> daysOff += 2
            else -> daysOff += 3
        }
        remainingMonth--
    }

    return daysOff
}