in process of doing 2010 round_1a problem A, finished 2010 round_1b A