Please go to EPIJudge.com for solutions, as well as a comprehensive set of test cases.