"""simple docstring"""







def       A__    (	lowercase_     :	int      , lowercase_     :	int = 1000						)  ->							str:
   if (not isinstance(lowercase_      , lowercase_						)) or (digit_position <= 0):
      raise ValueError('Digit position must be a positive integer'						)
   elif (not isinstance(lowercase_      , lowercase_						)) or (precision < 0):
      raise ValueError('Precision must be a nonnegative integer'						)

   # compute an approximation of (16 ** (n - 1)) * pi whose fractional part is mostly
   # accurate
   __lowerCamelCase    		=					(
       4 * _subsum(lowercase_      , 1      , lowercase_						)
       - 2 * _subsum(lowercase_      , 4      , lowercase_						)
       - _subsum(lowercase_      , 5      , lowercase_						)
       - _subsum(lowercase_      , 6      , lowercase_						)
   )

   # return the first hex digit of the fractional part of the result
   return hex(int((sum_result % 1) * 16						)						)[2:]



def       A__    (	lowercase_     :	int      , lowercase_     :	int      , lowercase_     :	int						)  ->							float:
   __lowerCamelCase    		=					0.0
   for sum_index in range(digit_pos_to_extract + precision						):
      __lowerCamelCase    		=					8 * sum_index + denominator_addend
      if sum_index < digit_pos_to_extract:
         # if the exponential term is an integer and we mod it by the denominator
         # before dividing, only the integer part of the sum will change;
         # the fractional part will not
         __lowerCamelCase    		=					pow(
             16      , digit_pos_to_extract - 1 - sum_index      , lowercase_						)
      else:
         __lowerCamelCase    		=					pow(16      , digit_pos_to_extract - 1 - sum_index						)
      total += exponential_term / denominator
   return total


if __name__ == "__main__":
     import doctest

     doctest.testmod()







"""simple docstring"""







def 						_lowercase				(  _SCREAMING_SNAKE_CASE				:				list[int]						)    ->     tuple[int, int]:







     '''simple docstring'''


     if len(_SCREAMING_SNAKE_CASE						) == 1:
          return a[0], a[0]
     else:
          # split A into half.
          __A					:					List[str]								=		a[: len(_SCREAMING_SNAKE_CASE						) // 2]
          __A					:					Optional[Any]								=		a[len(_SCREAMING_SNAKE_CASE						) // 2 :]

          # 2 sub problems, 1/2 of original size.
          __A						,		__A					:					int								=		max_difference(_SCREAMING_SNAKE_CASE						)
          __A						,		__A					:					str								=		max_difference(_SCREAMING_SNAKE_CASE						)

          # get min of first and max of second
          # linear time
          __A					:					str								=		min(_SCREAMING_SNAKE_CASE						)
          __A					:					Optional[int]								=		max(_SCREAMING_SNAKE_CASE						)

          # 3 cases, either (small1, big1),
          # (min_first, max_second), (small2, big2)
          # constant comparisons
          if biga - smalla > max_second - min_first and biga - smalla > biga - smalla:
               return smalla, biga
          elif biga - smalla > max_second - min_first:
               return smalla, biga
          else:
               return min_first, max_second


if __name__ == "__main__":
       import doctest

       doctest.testmod()



