Recursive change-making optimal substructure