def valid_decimal_range(bit_depth, S):
    """A helper to find valid range for Decimal(32|64|128|256) with given scale (S)"""
    return {
        32: -1 * 10 ** (9 - S),
        64: -1 * 10 ** (18 - S),
        128: -1 * 10 ** (38 - S),
        256: -1 * 10 ** (76 - S),
    }[bit_depth]