/**
 * Calculate the legal fees based on the case type and number of documents.
 *
 * @param caseType The type of the case.
 * @param numberOfDocuments The total number of documents involved in the case.
 * @return The calculated legal fees.
 */
fun calculateLegalFees(caseType: String, numberOfDocuments: Int): Double {

    var legalFees = 0.0

    when (caseType) {
        "divorce" -> {
            var docs = numberOfDocuments
            while (docs > 0) {
                legalFees += 500.0
                docs--
            }
        }
        "criminal" -> {
            var docs = numberOfDocuments
            while (docs > 0) {
                legalFees += 750.0
                docs -= 2
            }
        }
        "corporate" -> {
            var docs = numberOfDocuments
            while (docs > 0) {
                legalFees += 1000.0
                docs -= 3
            }
        }
    }

    return legalFees
}
/**
 * Calculate the legal fees based on the case type and number of documents.
 *
 * @param caseType The type of the case.
 * @param numberOfDocuments The total number of documents involved in the case.
 * @return The calculated legal fees.
 */
fun calculateLegalFees(caseType: String, numberOfDocuments: Int): Double {
/**
 * Calculate the legal fees based on the case type and number of documents.
 *
 * @param caseType The type of the case.
 * @param numberOfDocuments The total number of documents involved in the case.
 * @return The calculated legal fees.
 */
fun calculateLegalFees(caseType: String, numberOfDocuments: Int): Double {

    var legalFees = 0.0

    when (caseType) {
        "divorce" -> {
            var docs = numberOfDocuments
            while (docs > 0) {
                legalFees += 500.0
                docs--
            }
        }
        "criminal" -> {
            var docs = numberOfDocuments
            while (docs > 0) {
                legalFees += 750.0
                docs -= 2
            }
        }
        "corporate" -> {
            var docs = numberOfDocuments
            while (docs > 0) {
                legalFees += 1000.0
                docs -= 3
            }
        }
    }

    return legalFees
}