This problem is in Contest(s) below:
Contest 1213:武进区第8届小学生程序设计竞赛
Contest 1633:WJOI2015
Contest 1623:2018秋季C++高级课堂练习1
Contest 1411:cz初级班第13课作业