problem 1001 of pku online judge