This problem is used in private contest:C++挑战赛1
C++挑战赛6
C++挑战赛7