```python
def line_cost(price: int, quantity: int) -> int:
    """
    Calculate the cost of a single line of a basket.
    
    Args:
    price (int): The unit price of the item.
    quantity (int): The quantity of the item.
    
    Returns:
    int: The total cost of the line,    """
    if price <= 0 or quantity <= 0:
        raise ValueError("Price and quantity must be positive.")
    return price * quantity

def basket_cost(lines: list, discount: int) -> int:
    """
    Calculate the total cost of a basket after applying a discount.
    
    Args:
    lines (list): A of line costs.
    discount (int): The discount percentage to apply.
    
    Returns:
    int: The total cost of the basket after the discount.
    """
    if lines is None:
        return 0
    if discount > 100:
        raise ValueError("Discount must be between 0 and 100")
    total_cost = sum(lines)
    if total_cost > 100:
        total_cost -= total_cost * (discount / 100)
    return round(total_cost, 2)
```