codejam: refactored 2008 Practice Problem C to work with large dataset