This problem is in Contest(s) below:
Contest 1976:2024年csp-x
Contest 1983:1.14练习
Contest 2070:小学组真题测试