This problem is in Contest(s) below:
Contest 1009:Python加强班作业06
Contest 1040:CCC Junior 实战刷题
Contest 1006:NOIP--普及组--练习题库