This problem is in Contest(s) below:
Contest 1785:csp-j第一二题
Contest 2068:区一中小学组开学测试
Contest 2071:区一中普及组真题练习