



'''simple docstring'''




import os
import string
import sys


lowerCamelCase							:Union[str, Any]				    =					1 << 8

lowerCamelCase							:Any				    =					{
    'tab': ord('''\t'''),
    'newline': ord('''\r'''),
    'esc': 2_7,
    'up': 6_5 + ARROW_KEY_FLAG,
    'down': 6_6 + ARROW_KEY_FLAG,
    'right': 6_7 + ARROW_KEY_FLAG,
    'left': 6_8 + ARROW_KEY_FLAG,
    'mod_int': 9_1,
    'undefined': sys.maxsize,
    'interrupt': 3,
    'insert': 5_0,
    'delete': 5_1,
    'pg_up': 5_3,
    'pg_down': 5_4,
}

lowerCamelCase							:Optional[Any]				    =					KEYMAP['up']
lowerCamelCase							:Optional[int]				    =					KEYMAP['left']

if sys.platform == "win32":
						lowerCamelCase							:Union[str, Any]				    =					[]
						lowerCamelCase							:Dict				    =					{
						    b'\xe0H': KEYMAP['up'] - ARROW_KEY_FLAG,
						    b'\x00H': KEYMAP['up'] - ARROW_KEY_FLAG,
						    b'\xe0P': KEYMAP['down'] - ARROW_KEY_FLAG,
						    b'\x00P': KEYMAP['down'] - ARROW_KEY_FLAG,
						    b'\xe0M': KEYMAP['right'] - ARROW_KEY_FLAG,
						    b'\x00M': KEYMAP['right'] - ARROW_KEY_FLAG,
						    b'\xe0K': KEYMAP['left'] - ARROW_KEY_FLAG,
						    b'\x00K': KEYMAP['left'] - ARROW_KEY_FLAG,
						}

for i in range(1_0):
						lowerCamelCase							:Tuple				    =					ord(str(i))



def 	a			( ):
			'''simple docstring'''





			if os.name == "nt":
						import msvcrt

						A_	:						Optional[Any]	=     """mbcs"""
						# Flush the keyboard buffer
						while msvcrt.kbhit():
									msvcrt.getch()
						if len(a__    ) == 0:
									# Read the keystroke
									A_	:						Union[str, Any]	=     msvcrt.getch()

									# If it is a prefix char, get second part
									if ch in (b"\x00", b"\xe0"):
												A_	:						str	=     ch + msvcrt.getch()
												# Translate actual Win chars to bullet char types
												try:
															A_	:						int	=     chr(WIN_KEYMAP[cha]    )
															WIN_CH_BUFFER.append(chr(KEYMAP["""mod_int"""]    )    )
															WIN_CH_BUFFER.append(a__    )
															if ord(a__    ) in (
															    KEYMAP["insert"] - 1 << 9,
															    KEYMAP["delete"] - 1 << 9,
															    KEYMAP["pg_up"] - 1 << 9,
															    KEYMAP["pg_down"] - 1 << 9,
															):
																		WIN_CH_BUFFER.append(chr(1_26    )    )
															A_	:						List[str]	=     chr(KEYMAP["""esc"""]    )
												except KeyError:
															A_	:						Optional[int]	=     cha[1]
									else:
												A_	:						List[Any]	=     ch.decode(a__    )
						else:
									A_	:						Tuple	=     WIN_CH_BUFFER.pop(0    )
			elif os.name == "posix":
						import termios
						import tty

						A_	:						int	=     sys.stdin.fileno()
						A_	:						List[Any]	=     termios.tcgetattr(a__    )
						try:
									tty.setraw(a__    )
									A_	:						Union[str, Any]	=     sys.stdin.read(1    )
						finally:
									termios.tcsetattr(a__						,      termios.TCSADRAIN						,      a__    )
			return ch



def 	a			( ):
			'''simple docstring'''





			A_	:						Any	=     get_raw_chars()
			if ord(a__    ) in [KEYMAP["interrupt"], KEYMAP["newline"]]:
						return char

			elif ord(a__    ) == KEYMAP["esc"]:
						A_	:						int	=     get_raw_chars()
						if ord(a__    ) == KEYMAP["mod_int"]:
									A_	:						List[Any]	=     get_raw_chars()
									if ord(a__    ) >= KEYMAP["arrow_begin"] - ARROW_KEY_FLAG and ord(a__    ) <= KEYMAP["arrow_end"] - ARROW_KEY_FLAG:
												return chr(ord(a__    ) + ARROW_KEY_FLAG    )
									else:
												return KEYMAP["undefined"]
						else:
									return get_raw_chars()

			else:
						if char in string.printable:
									return char
						else:
									return KEYMAP["undefined"]


'''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=' ')






