This problem is in Contest(s) below:
Contest 1987:算法基础班结业测试
Contest 2072:小学组循环训练