This problem is in Contest(s) below:
Contest 1141:基础班-排序
Contest 1163:C++程序设计习题
Contest 1155:2024秋季基础班作业