@staticmethod
def base_convert(n, b):
    if (not n):
        return [0]
    res = []
    while n:
        (n, r) = divmod(n, b)
        if (r < 0):
            n += 1
            r -= b
        res.append(r)
    return res
@staticmethod
def base_convert(n, b):
    if (not n):
        return [0]
    res = []
    while n:
        (n, r) = divmod(n, b)
        if (r < 0):
            n += 1
            r -= b
        res.append(r)
    return res