This problem is in Contest(s) below:
Contest 1164:GESP C++ 2025年9月一级到三级
Contest 1176:GESP三级考试编程第一题汇总