




'''simple docstring'''





import logging

from transformers.configuration_utils import PretrainedConfig


_SCREAMING_SNAKE_CASE							:   Tuple      		= logging.getLogger(__name__)




class  _snake_case		(	lowerCAmelCase_							):
			lowerCAmelCase_     :      List[str]						       =    'masked_bert'




			def __init__(					self				,							a__=30_522				,							a__=768				,							a__=12				,							a__=12				,							a__=3_072				,							a__="gelu"				,							a__=0.1				,							a__=0.1				,							a__=512				,							a__=2				,							a__=0.0_2				,							a__=1e-12				,							a__=0				,							a__="topK"				,							a__="constant"				,							a__=0.0				,							**a__				,							)				->				Dict:

										'''simple docstring'''




										super().__init__(pad_token_id=__lowerCAmelCase				,							**__lowerCAmelCase							)

										snake_case_						=      vocab_size
										snake_case_						=      hidden_size
										snake_case_						=      num_hidden_layers
										snake_case_						=      num_attention_heads
										snake_case_						=      hidden_act
										snake_case_						=      intermediate_size
										snake_case_						=      hidden_dropout_prob
										snake_case_						=      attention_probs_dropout_prob
										snake_case_						=      max_position_embeddings
										snake_case_						=      type_vocab_size
										snake_case_						=      initializer_range
										snake_case_						=      layer_norm_eps
										snake_case_						=      pruning_method
										snake_case_						=      mask_init
										snake_case_						=      mask_scale





"""simple docstring"""


from math import pow






def 			__UpperCAmelCase    (	lowercase      ,lowercase      ,lowercase      ,lowercase      ,lowercase      ,):







  """simple docstring"""
  if current_sum == needed_sum:
    # If the sum of the powers is equal to needed_sum, then we have a solution.
    solutions_count += 1
    return current_sum, solutions_count

  _UpperCAmelCase         =					int(pow(lowercase      ,lowercase						)						)
  if current_sum + i_to_n <= needed_sum:
    # If the sum of the powers is less than needed_sum, then continue adding powers.
    current_sum += i_to_n
    _UpperCAmelCase       , _UpperCAmelCase         =					backtrack(
        lowercase      ,lowercase      ,current_number + 1      ,lowercase      ,lowercase						)
    current_sum -= i_to_n
  if i_to_n < needed_sum:
    # If the power of i is less than needed_sum, then try with the next power.
    _UpperCAmelCase       , _UpperCAmelCase         =					backtrack(
        lowercase      ,lowercase      ,current_number + 1      ,lowercase      ,lowercase						)
  return current_sum, solutions_count






def 			__UpperCAmelCase    (	lowercase      ,lowercase						):







  """simple docstring"""
  if not (1 <= needed_sum <= 10_00 and 2 <= power <= 10):
    raise ValueError(
        """Invalid input\n"""
        """needed_sum must be between 1 and 1000, power between 2 and 10."""						)

  return backtrack(lowercase      ,lowercase      ,1      ,0      ,0						)[1]  # Return the solutions_count


if __name__ == "__main__":
    import doctest

    doctest.testmod()
