This problem is in Contest(s) below:
Contest 1042:基础提高2
Contest 1039:基础提高班
Contest 1055:基础提高6
Contest 1920:七、八年级基础算法复习题目