Store Credit

Google Code Jam South Africa 2010 problem.
https://code.google.com/codejam/contest/351101/dashboard#s=p0