update algorithm to meet the process time.
update the answer of 10023.