```python
def hour_rate(rate: int) -> int:
    """Return the hourly rate."""
    return rate


def week_pay(hours: int, rate: int) -> int:
    """Pay for a week, with overtime beyond forty hours.

    Pays the stated rate for up to 40 hours, and 1.5x the rate
    for every hour beyond 40. All amounts are rounded down.
    """
    if hours <= 40:
        return hours * hour_rate(rate)
    regular = 40 * hour_rate(rate)
    overtime = (hours - 40) * hour_rate(rate) * 3 // 2
    return regular + overtime
```

The bug in the original `week_pay` was that it only applied the overtime multiplier to the *total* hours (i.e., `hours * rate * 3 // 2`), which overpays the first 40 hours. The fix splits the pay into a regular portion for the first 40 hours and a separate overtime portion for hours beyond 40, each at the correct rate.