This problem is in Contest(s) below:
Contest 4142:基础C-第1课-课堂练习
Contest 4213:酷玩教育人工智能挑战赛编程比赛