




__a    :						Dict						      =       range(2, 2_0 + 1)
__a    :						str						      =       [1_0**k for k in range(ks[-1] + 1)]
__a    :						List[str]						      =       {}
def    snake_case_	(						SCREAMING_SNAKE_CASE_							,SCREAMING_SNAKE_CASE_							,SCREAMING_SNAKE_CASE_							,SCREAMING_SNAKE_CASE_							)     ->					Optional[Any]:
							lowercase__    :			Union[str, Any]     =				sum(a_i[j] for j in range(snake_case__							,len(snake_case__							)							)							)
							lowercase__    :			Dict     =				sum(a_i[j] * base[j] for j in range(min(len(snake_case__							)							,snake_case__							)							)							)

							lowercase__    :			str     =				0, 0
							lowercase__    :			Optional[Any]     =				n - i

							lowercase__    :			int     =				memo.get(snake_case__							)

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

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

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

														else:
																					lowercase__    :			Tuple     =				[]
							else:
														lowercase__    :			List[Any]     =				{c: []}
														lowercase__    :			str     =				sub_memo

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

							if k > ks[0]:
														while True:
																					# keep doing smaller jumps
																					lowercase__    :			List[Any]     =				next_term(snake_case__							,k - 1							,i + dn							,snake_case__							)
																					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
														lowercase__    :			str     =				compute(snake_case__							,snake_case__							,i + dn							,snake_case__							)
														diff += _diff
														dn += terms_jumped

							lowercase__    :			List[Any]     =				sub_memo[c]

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

							# cache the jump for this value digitsum(b) and c
							sub_memo[c].insert(snake_case__							,(diff, dn, k)							)
							return (diff, dn)
def    snake_case_	(						SCREAMING_SNAKE_CASE_							,SCREAMING_SNAKE_CASE_							,SCREAMING_SNAKE_CASE_							,SCREAMING_SNAKE_CASE_							)     ->					int:






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

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

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

																					ds_c += a_i[j]

														if addend > 0:
																					break

							if addend > 0:
														add(snake_case__							,snake_case__							,snake_case__							)
							return diff, i - start_i
def    snake_case_	(						SCREAMING_SNAKE_CASE_							,SCREAMING_SNAKE_CASE_							,SCREAMING_SNAKE_CASE_							)     ->					str:






							for j in range(snake_case__							,len(snake_case__							)							):
														lowercase__    :			List[str]     =				digits[j] + addend
														if s >= 10:
																					lowercase__    :			Dict     =				divmod(snake_case__							,10							)
																					lowercase__    :			List[Any]     =				addend // 10 + quotient
														else:
																					lowercase__    :			Optional[int]     =				s
																					lowercase__    :			int     =				addend // 10

														if addend == 0:
																					break

							while addend > 0:
														lowercase__    :			List[Any]     =				divmod(snake_case__							,10							)
														digits.append(snake_case__							)
def    snake_case_	(						SCREAMING_SNAKE_CASE_ = 10**15							)     ->					Dict:
							lowercase__    :			Optional[Any]     =				[1]
							lowercase__    :			Tuple     =				1
							lowercase__    :			Union[str, Any]     =				0
							while True:
														lowercase__    :			Optional[int]     =				next_term(snake_case__							,20							,i + dn							,snake_case__							)
														dn += terms_jumped
														if dn == n - i:
																					break

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


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







def 	UpperCamelCase	(							snake_case__  : float						,snake_case__  : int	):




     '''simple docstring'''






     if digit_amount > 0:
          return round(number - int(snake_case__	)						,snake_case__	)
     return number - int(snake_case__	)


if __name__ == "__main__":
     print(decimal_isolate(1.5_3, 0))
     print(decimal_isolate(3_5.3_4_5, 1))
     print(decimal_isolate(3_5.3_4_5, 2))
     print(decimal_isolate(3_5.3_4_5, 3))
     print(decimal_isolate(-1_4.7_8_9, 3))
     print(decimal_isolate(0, 2))
     print(decimal_isolate(-1_4.1_2_3, 1))
     print(decimal_isolate(-1_4.1_2_3, 2))
     print(decimal_isolate(-1_4.1_2_3, 3))


