Hi, I am trying solve coin change making problem using dynamic programming but I have double problem because I can't use 1 coins. My coins are {2,5,25,50};
you cannot make change that results in 1 and 3, then. It simply cannot be done unless you have pieces of 8 and can cut them in half :P
in the case of 3, you can give them a 2 and short them by 1 or over pay them by 1.
in the case of 1, you can over pay by 1.
Any other result is possible, so its on you to get that to happen. Maybe think of it like a bank's teller machine: it can't give 1's and I don't think it can give 5's, so you have to tell the user to stop being an idiot and put in a reasonable amount until they comply.