Modified candidate, can solve 2008-Round1A-C small input.