This problem is in Contest(s) below:
Contest 229:算法初级第x+1次课
Contest 173:GESP四级复习-(2)