This problem is in Contest(s) below:
Contest 2070:小学组真题测试
Contest 2013:分段测试
Contest 1997:贪心练习