Solve Problem#9 and Problem#10