



'''simple docstring'''





from __future__ import annotations

import math
def    _SCREAMING_SNAKE_CASE  (       UpperCamelCase							,    UpperCamelCase							,    UpperCamelCase							,    UpperCamelCase							,    UpperCamelCase			):



    """simple docstring"""





    if depth < 0:
        raise ValueError("""Depth cannot be less than 0"""			)

    if not scores:
        raise ValueError("""Scores cannot be empty"""			)

    if depth == height:
        return scores[node_index]

    return (
        max(
            minimax(depth + 1							,    node_index * 2							,    UpperCamelCase							,    UpperCamelCase							,    UpperCamelCase			)							,    minimax(depth + 1							,    node_index * 2 + 1							,    UpperCamelCase							,    UpperCamelCase							,    UpperCamelCase			)							,    )
        if is_max
        else min(
            minimax(depth + 1							,    node_index * 2							,    UpperCamelCase							,    UpperCamelCase							,    UpperCamelCase			)							,    minimax(depth + 1							,    node_index * 2 + 1							,    UpperCamelCase							,    UpperCamelCase							,    UpperCamelCase			)							,    )
    )
def    _SCREAMING_SNAKE_CASE  (       ):



    """simple docstring"""





    lowerCAmelCase__ :  Tuple							      =					[90, 23, 6, 33, 21, 65, 123, 34423]
    lowerCAmelCase__ :  Optional[int]							      =					math.log(len(UpperCamelCase			)							,    2			)
    print(f"""Optimal value : {minimax(0							,    0							,    UpperCamelCase							,    UpperCamelCase							,    UpperCamelCase			)}"""			)


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 main()





'''simple docstring'''



def    a__       (  a__      ,    a__						):




     """simple docstring"""


     __SCREAMING_SNAKE_CASE     =      int(a__						)

     # Initialize Result
     __SCREAMING_SNAKE_CASE     =      []

     # Traverse through all denomination
     for denomination in reversed(a__						):
          # Find denominations
          while int(a__						) >= int(a__						):
               total_value -= int(a__						)
               answer.append(a__						)  # Append the "answers" array

     return answer


# Driver Code
if __name__ == "__main__":
  UpperCAmelCase :       Dict			   =     []
  UpperCAmelCase :       List[str]			   =     '0'

  if (
      input('Do you want to enter your denominations ? (yY/n): ').strip().lower()
      == "y"
  ):
    UpperCAmelCase :       List[str]			   =     int(input('Enter the number of denominations you want to add: ').strip())

    for i in range(0, n):
      denominations.append(int(input(f"""Denomination {i}: """).strip()))
    UpperCAmelCase :       str			   =     input('Enter the change you want to make in Indian Currency: ').strip()
  else:
    # All denominations of Indian Currency if user does not enter
    UpperCAmelCase :       int			   =     [1, 2, 5, 1_0, 2_0, 5_0, 1_0_0, 5_0_0, 2_0_0_0]
    UpperCAmelCase :       Any			   =     input('Enter the change you want to make: ').strip()

  if int(value) == 0 or int(value) < 0:
    print('The total value cannot be zero or negative.')

  else:
    print(f"""Following is minimal change for {value}: """)
    UpperCAmelCase :       Any			   =     find_minimum_change(denominations, value)
    # Print result
    for i in range(len(answer)):
      print(answer[i], end=' ')






