This problem is in Contest(s) below:
Contest 1023:信息学算法编程期末测试(初中)