This problem is used in private contest:栈、队列与递归算法设计