This problem is in Contest(s) below:
Contest 1701:2024C++入门10
Contest 1045:C++编程训练4
Contest 1000:Python编程入门训练1
Contest 1769:2025暑期Python训练1