
'''simple docstring'''
lowercase__						       =      range(2, 2_0 + 1)
lowercase__						       =      [1_0**k for k in range(ks[-1] + 1)]
lowercase__						       =      {}




def    _UpperCamelCase						(       SCREAMING_SNAKE_CASE__ ,       SCREAMING_SNAKE_CASE__ ,       SCREAMING_SNAKE_CASE__ ,       SCREAMING_SNAKE_CASE__			)  ->							Tuple:


		'''simple docstring'''


		snake_case  :       Union[str, Any]     			=						sum(a_i[j] for j in range(SCREAMING_SNAKE_CASE__ ,       len(SCREAMING_SNAKE_CASE__			)			)			)
		snake_case  :       List[str]     			=						sum(a_i[j] * base[j] for j in range(min(len(SCREAMING_SNAKE_CASE__			) ,       SCREAMING_SNAKE_CASE__			)			)			)

		snake_case			,snake_case  :       int     			=						0, 0
		snake_case  :       Optional[Any]     			=						n - i

		snake_case  :       List[Any]     			=						memo.get(SCREAMING_SNAKE_CASE__			)

		if sub_memo is not None:
				snake_case  :       Union[str, Any]     			=						sub_memo.get(SCREAMING_SNAKE_CASE__			)

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

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

				else:
						snake_case  :       int     			=						[]
		else:
				snake_case  :       Dict     			=						{c: []}
				snake_case  :       Dict     			=						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  :       Tuple     			=						next_term(SCREAMING_SNAKE_CASE__ ,       k - 1 ,       i + dn ,       SCREAMING_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
				snake_case			,snake_case  :       Any     			=						compute(SCREAMING_SNAKE_CASE__ ,       SCREAMING_SNAKE_CASE__ ,       i + dn ,       SCREAMING_SNAKE_CASE__			)
				diff += _diff
				dn += terms_jumped

		snake_case  :       Any     			=						sub_memo[c]

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

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




def    _UpperCamelCase						(       SCREAMING_SNAKE_CASE__ ,       SCREAMING_SNAKE_CASE__ ,       SCREAMING_SNAKE_CASE__ ,       SCREAMING_SNAKE_CASE__			)  ->							Dict:


		'''simple docstring'''


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

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

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

						ds_c += a_i[j]

				if addend > 0:
						break

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




def    _UpperCamelCase						(       SCREAMING_SNAKE_CASE__ ,       SCREAMING_SNAKE_CASE__ ,       SCREAMING_SNAKE_CASE__			)  ->							Optional[int]:


		'''simple docstring'''


		for j in range(SCREAMING_SNAKE_CASE__ ,       len(SCREAMING_SNAKE_CASE__			)			):
				snake_case  :       Union[str, Any]     			=						digits[j] + addend
				if s >= 10:
						snake_case			,snake_case  :       List[Any]     			=						divmod(SCREAMING_SNAKE_CASE__ ,       10			)
						snake_case  :       List[str]     			=						addend // 10 + quotient
				else:
						snake_case  :       List[str]     			=						s
						snake_case  :       List[str]     			=						addend // 10

				if addend == 0:
						break

		while addend > 0:
				snake_case			,snake_case  :       Dict     			=						divmod(SCREAMING_SNAKE_CASE__ ,       10			)
				digits.append(SCREAMING_SNAKE_CASE__			)




def    _UpperCamelCase						(       SCREAMING_SNAKE_CASE__ = 10**15			)  ->							int:


		'''simple docstring'''


		snake_case  :       Optional[Any]     			=						[1]
		snake_case  :       str     			=						1
		snake_case  :       Union[str, Any]     			=						0
		while True:
				snake_case			,snake_case  :       Any     			=						next_term(SCREAMING_SNAKE_CASE__ ,       20 ,       i + dn ,       SCREAMING_SNAKE_CASE__			)
				dn += terms_jumped
				if dn == n - i:
						break

		snake_case  :       Dict     			=						0
		for j in range(len(SCREAMING_SNAKE_CASE__			)			):
				a_n += digits[j] * 10**j
		return a_n


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




'''simple docstring'''
from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


lowercase__						       =      logging.get_logger(__name__)

lowercase__						       =      {
    "hustvl/yolos-small": "https://huggingface.co/hustvl/yolos-small/resolve/main/config.json",
    # See all YOLOS models at https://huggingface.co/models?filter=yolos
}






class 	snake_case__       (      __SCREAMING_SNAKE_CASE					):







		"""simple docstring"""

		lowerCamelCase     							=						"""yolos"""



		def __init__(      self				:			Any  ,	UpperCamelCase__				:			Optional[Any]=768  ,	UpperCamelCase__				:			Any=12  ,	UpperCamelCase__				:			Optional[int]=12  ,	UpperCamelCase__				:			Union[str, Any]=3072  ,	UpperCamelCase__				:			str="gelu"  ,	UpperCamelCase__				:			Union[str, Any]=0.0  ,	UpperCamelCase__				:			Union[str, Any]=0.0  ,	UpperCamelCase__				:			Union[str, Any]=0.02  ,	UpperCamelCase__				:			List[Any]=1e-1_2  ,	UpperCamelCase__				:			List[Any]=[512, 864]  ,	UpperCamelCase__				:			int=16  ,	UpperCamelCase__				:			Union[str, Any]=3  ,	UpperCamelCase__				:			Union[str, Any]=True  ,	UpperCamelCase__				:			int=100  ,	UpperCamelCase__				:			Optional[Any]=True  ,	UpperCamelCase__				:			int=False  ,	UpperCamelCase__				:			Dict=1  ,	UpperCamelCase__				:			Optional[int]=5  ,	UpperCamelCase__				:			List[str]=2  ,	UpperCamelCase__				:			Union[str, Any]=5  ,	UpperCamelCase__				:			Union[str, Any]=2  ,	UpperCamelCase__				:			int=0.1  ,	**UpperCamelCase__				:			Optional[Any]  ,	)						->			Any:






				"""simple docstring"""







				super().__init__(**UpperCamelCase__      )

				snake_case  :       List[str]     			=						hidden_size
				snake_case  :       Union[str, Any]     			=						num_hidden_layers
				snake_case  :       List[str]     			=						num_attention_heads
				snake_case  :       Any     			=						intermediate_size
				snake_case  :       int     			=						hidden_act
				snake_case  :       Optional[Any]     			=						hidden_dropout_prob
				snake_case  :       int     			=						attention_probs_dropout_prob
				snake_case  :       Union[str, Any]     			=						initializer_range
				snake_case  :       List[Any]     			=						layer_norm_eps
				snake_case  :       Tuple     			=						image_size
				snake_case  :       Any     			=						patch_size
				snake_case  :       str     			=						num_channels
				snake_case  :       Optional[int]     			=						qkv_bias
				snake_case  :       Optional[Any]     			=						num_detection_tokens
				snake_case  :       Dict     			=						use_mid_position_embeddings
				snake_case  :       List[Any]     			=						auxiliary_loss
				# Hungarian matcher
				snake_case  :       List[str]     			=						class_cost
				snake_case  :       Optional[Any]     			=						bbox_cost
				snake_case  :       Tuple     			=						giou_cost
				# Loss coefficients
				snake_case  :       Union[str, Any]     			=						bbox_loss_coefficient
				snake_case  :       List[Any]     			=						giou_loss_coefficient
				snake_case  :       Tuple     			=						eos_coefficient







class 	snake_case__       (      __SCREAMING_SNAKE_CASE					):







		"""simple docstring"""

		lowerCamelCase     							=						version.parse("""1.11"""					)



		@property
		def       lowerCAmelCase				(      self				:			int      )						->			Mapping[str, Mapping[int, str]]:






				"""simple docstring"""







				return OrderedDict(
				    [
				        ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
				    ]      )



		@property
		def       lowerCAmelCase				(      self				:			int      )						->			float:






				"""simple docstring"""







				return 1e-4



		@property
		def       lowerCAmelCase				(      self				:			Tuple      )						->			int:






				"""simple docstring"""







				return 12


