```python
def line_cost(price: int, quantity: int) -> int:
    """Calculate the cost of one line based on unit price and quantity."""
    if price < 0 or quantity < 0:
        raise ValueError("Price and quantity must be non-negative integers.")
    return price * quantity


def basket_cost(lines: list, discount: int) -> int:
    """Calculate the total cost of a basket after applying a whole-percent discount."""
    if discount < 0 or discount > 100:
        raise ValueError("Discount must be between 0 and 100 percent.")
    if not lines:
        return 0
    
    total_cost = sum(line_cost(price, quantity) for price, quantity in lines)
    discounted_cost = total_cost - (total_cost * discount // 100)
    return discounted_cost
```