This problem is in Contest(s) below:
Contest 1003:竞赛基础题型练习
Contest 1034:入门班打卡题