def relax_w(min_w, relax_factor, base=2):
    """
    Scale min_w by relax_factor and round to the nearest multiple of base.
    """
    relaxed_w = int(base * round(min_w * relax_factor / base))
    return relaxed_w