def distribute_money(money, children, extra_amount=8):
    """
    Calculates the maximum number of children who can receive an extra amount of money,
    given a total amount of money and the number of children.

    Args:
        money: The total amount of money.
        children: The number of children.
        extra_amount: The extra amount of money each child can receive.

    Returns:
        The maximum number of children who can receive the extra amount.
    """

    if money < children or money > children * (extra_amount + 1):
        return -1

    remaining_money = money - children
    max_extra = remaining_money // extra_amount
    return min(max_extra, children)

# Examples
examples = [
    (16, 2),
    (20, 3),
    # ...
]

for money, children in examples:
    result = distribute_money(money, children)
    print(f"Result: {result}")

