




"""simple docstring"""





from ...configuration_utils import PretrainedConfig
from ...utils import logging


A				=							logging.get_logger(__name__)

A				=							{
    """microsoft/trocr-base-handwritten""": (
        """https://huggingface.co/microsoft/trocr-base-handwritten/resolve/main/config.json"""
    ),
    # See all TrOCR models at https://huggingface.co/models?filter=trocr
}



class   a__					(						__magic_name__ ):
			lowercase_		=						"trocr"
			lowercase_		=						["past_key_values"]
			lowercase_		=						{
			    "num_attention_heads": "decoder_attention_heads",
			    "hidden_size": "d_model",
			    "num_hidden_layers": "decoder_layers",
			}


			def __init__(   self   :     Optional[Any]   ,	UpperCamelCase_   :     List[Any]=50265   ,	UpperCamelCase_   :     Any=1024   ,	UpperCamelCase_   :     Optional[Any]=12   ,	UpperCamelCase_   :     Any=16   ,	UpperCamelCase_   :     Optional[Any]=4096   ,	UpperCamelCase_   :     str="gelu"   ,	UpperCamelCase_   :     List[str]=512   ,	UpperCamelCase_   :     List[str]=0.1   ,	UpperCamelCase_   :     Optional[Any]=0.0   ,	UpperCamelCase_   :     str=0.0   ,	UpperCamelCase_   :     str=2   ,	UpperCamelCase_   :     List[str]=0.02   ,	UpperCamelCase_   :     Tuple=0.0   ,	UpperCamelCase_   :     List[Any]=True   ,	UpperCamelCase_   :     Dict=False   ,	UpperCamelCase_   :     Any=True   ,	UpperCamelCase_   :     Dict=True   ,	UpperCamelCase_   :     str=1   ,	UpperCamelCase_   :     str=0   ,	UpperCamelCase_   :     List[str]=2   ,	**UpperCamelCase_   :     Optional[Any]   ,	):


						"""simple docstring"""




						__UpperCAmelCase						:			List[Any]												=       vocab_size
						__UpperCAmelCase						:			str												=       d_model
						__UpperCAmelCase						:			Tuple												=       decoder_layers
						__UpperCAmelCase						:			Optional[Any]												=       decoder_attention_heads
						__UpperCAmelCase						:			Optional[int]												=       decoder_ffn_dim
						__UpperCAmelCase						:			Optional[int]												=       activation_function
						__UpperCAmelCase						:			Optional[int]												=       max_position_embeddings
						__UpperCAmelCase						:			Union[str, Any]												=       dropout
						__UpperCAmelCase						:			str												=       attention_dropout
						__UpperCAmelCase						:			Any												=       activation_dropout
						__UpperCAmelCase						:			Any												=       init_std
						__UpperCAmelCase						:			List[str]												=       decoder_layerdrop
						__UpperCAmelCase						:			Tuple												=       use_cache
						__UpperCAmelCase						:			str												=       scale_embedding
						__UpperCAmelCase						:			str												=       use_learned_position_embeddings
						__UpperCAmelCase						:			List[Any]												=       layernorm_embedding

						super().__init__(
						    pad_token_id=UpperCamelCase_   ,	bos_token_id=UpperCamelCase_   ,	eos_token_id=UpperCamelCase_   ,	decoder_start_token_id=UpperCamelCase_   ,	**UpperCamelCase_   ,	)








SCREAMING_SNAKE_CASE:     dict[tuple[int, int, int], int]									= {}


def 					_a							(					lowerCAmelCase    ,						lowerCAmelCase    ,						lowerCAmelCase )->	int:

		# if we are absent twice, or late 3 consecutive days,
		# no further prize strings are possible
		if late == 3 or absent == 2:
				return 0

		# if we have no days left, and have not failed any other rules,
		# we have a prize string
		if days == 0:
				return 1

		# No easy solution, so now we need to do the recursive calculation

		# First, check if the combination is already in the cache, and
		# if yes, return the stored value from there since we already
		# know the number of possible prize strings from this point on
		SCREAMING_SNAKE_CASE_					      =							(days, absent, late)
		if key in cache:
				return cache[key]

		# now we calculate the three possible ways that can unfold from
		# this point on, depending on our attendance today

		# 1) if we are late (but not absent), the "absent" counter stays as
		# it is, but the "late" counter increases by one
		SCREAMING_SNAKE_CASE_					      =							_calculate(days - 1    ,						lowerCAmelCase    ,						late + 1 )

		# 2) if we are absent, the "absent" counter increases by 1, and the
		# "late" counter resets to 0
		SCREAMING_SNAKE_CASE_					      =							_calculate(days - 1    ,						absent + 1    ,						0 )

		# 3) if we are on time, this resets the "late" counter and keeps the
		# absent counter
		SCREAMING_SNAKE_CASE_					      =							_calculate(days - 1    ,						lowerCAmelCase    ,						0 )

		SCREAMING_SNAKE_CASE_					      =							state_late + state_absent + state_ontime

		SCREAMING_SNAKE_CASE_					      =							prizestrings
		return prizestrings


def 					_a							(					lowerCAmelCase = 30 )->	int:
		return _calculate(lowerCAmelCase    ,						absent=0    ,						late=0 )


if __name__ == "__main__":
						print(solution())