http://community.topcoder.com/stat?c=problem_statement&pm=13392