This problem is in Contest(s) below:
Contest 1261:深搜入门
Contest 1037:课程A
Contest 1235:课程A