
__magic_name__            =  range(2, 20 + 1)
__magic_name__            =  [10**k for k in range(ks[-1] + 1)]
__magic_name__            =  {}





def 	SCREAMING_SNAKE_CASE__    (      __lowerCAmelCase    ,		__lowerCAmelCase    ,		__lowerCAmelCase    ,		__lowerCAmelCase							):
    snake_case__						=				sum(a_i[j] for j in range(__lowerCAmelCase    ,		len(__lowerCAmelCase							)							)							)
    snake_case__						=				sum(a_i[j] * base[j] for j in range(min(len(__lowerCAmelCase							)    ,		__lowerCAmelCase							)							)							)

    snake_case__						,					snake_case__						=				0, 0
    snake_case__						=				n - i

    snake_case__						=				memo.get(__lowerCAmelCase							)

    if sub_memo is not None:
        snake_case__						=				sub_memo.get(__lowerCAmelCase							)

        if jumps is not None and len(__lowerCAmelCase							) > 0:
            # find and make the largest jump without going over
            snake_case__						=				-1
            for _k in range(len(__lowerCAmelCase							) - 1    ,		-1    ,		-1							):
                if jumps[_k][2] <= k and jumps[_k][1] <= max_dn:
                    snake_case__						=				_k
                    break

            if max_jump >= 0:
                snake_case__						,					snake_case__						,					snake_case__						=				jumps[max_jump]
                # since the difference between jumps is cached, add c
                snake_case__						=				diff + c
                for j in range(min(__lowerCAmelCase    ,		len(__lowerCAmelCase							)							)							):
                    snake_case__						,					snake_case__						=				divmod(__lowerCAmelCase    ,		10							)
                if new_c > 0:
                    add(__lowerCAmelCase    ,		__lowerCAmelCase    ,		__lowerCAmelCase							)

        else:
            snake_case__						=				[]
    else:
        snake_case__						=				{c: []}
        snake_case__						=				sub_memo

    if dn >= max_dn or c + diff >= base[k]:
        return diff, dn

    if k > ks[0]:
        while True:
            # keep doing smaller jumps
            snake_case__						,					snake_case__						=				next_term(__lowerCAmelCase    ,		k - 1    ,		i + dn    ,		__lowerCAmelCase							)
            diff += _diff
            dn += terms_jumped

            if dn >= max_dn or c + diff >= base[k]:
                break
    else:
        # would be too small a jump, just compute sequential terms instead
        snake_case__						,					snake_case__						=				compute(__lowerCAmelCase    ,		__lowerCAmelCase    ,		i + dn    ,		__lowerCAmelCase							)
        diff += _diff
        dn += terms_jumped

    snake_case__						=				sub_memo[c]

    # keep jumps sorted by # of terms skipped
    snake_case__						=				0
    while j < len(__lowerCAmelCase							):
        if jumps[j][1] > dn:
            break
        j += 1

    # cache the jump for this value digitsum(b) and c
    sub_memo[c].insert(__lowerCAmelCase    ,		(diff, dn, k)							)
    return (diff, dn)





def 	SCREAMING_SNAKE_CASE__    (      __lowerCAmelCase    ,		__lowerCAmelCase    ,		__lowerCAmelCase    ,		__lowerCAmelCase							):
    if i >= n:
        return 0, i
    if k > len(__lowerCAmelCase							):
        a_i.extend([0 for _ in range(k - len(__lowerCAmelCase							)							)]							)

    # note: a_i -> b * 10^k + c
    # ds_b -> digitsum(b)
    # ds_c -> digitsum(c)
    snake_case__						=				i
    snake_case__						,					snake_case__						,					snake_case__						=				0, 0, 0
    for j in range(len(__lowerCAmelCase							)							):
        if j >= k:
            ds_b += a_i[j]
        else:
            ds_c += a_i[j]

    while i < n:
        i += 1
        snake_case__						=				ds_c + ds_b
        diff += addend
        snake_case__						=				0
        for j in range(__lowerCAmelCase							):
            snake_case__						=				a_i[j] + addend
            snake_case__						,					snake_case__						=				divmod(__lowerCAmelCase    ,		10							)

            ds_c += a_i[j]

        if addend > 0:
            break

    if addend > 0:
        add(__lowerCAmelCase    ,		__lowerCAmelCase    ,		__lowerCAmelCase							)
    return diff, i - start_i





def 	SCREAMING_SNAKE_CASE__    (      __lowerCAmelCase    ,		__lowerCAmelCase    ,		__lowerCAmelCase							):
    for j in range(__lowerCAmelCase    ,		len(__lowerCAmelCase							)							):
        snake_case__						=				digits[j] + addend
        if s >= 10:
            snake_case__						,					snake_case__						=				divmod(__lowerCAmelCase    ,		10							)
            snake_case__						=				addend // 10 + quotient
        else:
            snake_case__						=				s
            snake_case__						=				addend // 10

        if addend == 0:
            break

    while addend > 0:
        snake_case__						,					snake_case__						=				divmod(__lowerCAmelCase    ,		10							)
        digits.append(__lowerCAmelCase							)





def 	SCREAMING_SNAKE_CASE__    (      __lowerCAmelCase = 10**15							):
    snake_case__						=				[1]
    snake_case__						=				1
    snake_case__						=				0
    while True:
        snake_case__						,					snake_case__						=				next_term(__lowerCAmelCase    ,		20    ,		i + dn    ,		__lowerCAmelCase							)
        dn += terms_jumped
        if dn == n - i:
            break

    snake_case__						=				0
    for j in range(len(__lowerCAmelCase							)							):
        a_n += digits[j] * 10**j
    return a_n


if __name__ == "__main__":
     print(F'''{solution() = }''')





def 	SCREAMING_SNAKE_CASE__    (      __lowerCAmelCase    ,		__lowerCAmelCase							):
    return price * (1 + tax_rate)


if __name__ == "__main__":
     print(F'''{price_plus_tax(100, 0.2_5) = }''')
     print(F'''{price_plus_tax(1_2_5.5_0, 0.0_5) = }''')



