There is an ATM machine, it has a limited number of banknotes. The user wants to withdraw the amount S from an ATM. If possible, output a list of the minimum number of banknotes that give the required amount, otherwise write that withdrawal is impossible.
For example: There are banknotes in the ATM [1000, 1000, 500, 500, 100, 100, 100] Need to withdraw 1600 Result [1000, 500, 100]