This problem is in Contest(s) below:
Contest 1156:课堂测试
Contest 1079:入门班练习与作业