problem 1003 of pku online judge