This problem is in Contest(s) below:
Contest 1213:武进区第8届小学生程序设计竞赛
Contest 1628:2018秋季C++高级课堂练习3
Contest 1633:WJOI2015
Contest 1566:常规训练