Figuring out the best possible price discount for a customer given certain rules.