a solution of problem from pongo.cn