def calculate_cota(salary, num_children=0, pays_school=False, pays_rent=False, num_parents=0):
    # Calculate discounts
    discount = 0
    discount += 0.5 * num_children
    discount += 1 if pays_school else 0
    discount += 1 if pays_rent else 0
    discount += 0.5 * num_parents

    # Determine base percentage based on salary
    if salary < 1320.00:
        base_percentage = 3
    elif salary < 1980.00:
        base_percentage = 4
    elif salary < 2640.00:
        base_percentage = 5
    elif salary < 3300.00:
        base_percentage = 6
    elif salary < 3960.00:
        base_percentage = 7
    elif salary < 5280.00:
        base_percentage = 8
    elif salary < 6600.00:
        base_percentage = 9
    else:
        base_percentage = 10

    # Calculate final percentage after applying discounts
    final_percentage = base_percentage - discount
    final_percentage = max(final_percentage, 0)  # Ensure percentage is not negative

    # Calculate cota
    cota = (final_percentage / 100) * salary
    return cota 