This problem is in Contest(s) below:
Contest 1181:基础课程-多维数组
Contest 1154:2024秋基础强化班作业