document.write( "Question 1133178: what is the greatest amount of money you can have in coins aand still not be able to give change for a dollar? \n" ); document.write( "
Algebra.Com's Answer #750412 by greenestamps(13200)\"\" \"About 
You can put this solution on YOUR website!


\n" ); document.write( "Since you want the largest amount you can have without being able to make change for a dollar, use a \"greedy algorithm\" for solving the problem: take the largest number of quarters you can have without being able to make change for a dollar; add the largest number of dimes you can, still not being able to make change for a dollar, then do the same with nickels, and then with pennies.

\n" ); document.write( "-----------------------------------------------------------------

\n" ); document.write( "Added after seeing response from reader....

\n" ); document.write( "-----------------------------------------------------------------

\n" ); document.write( "3 quarters is the most you can have; with 4 of course you could make change for a dollar.

\n" ); document.write( "But you can have more than 2 dimes....

\n" ); document.write( "And then at the end the last thing you will add is 4 pennies.
\n" ); document.write( "
\n" );