This problem is in Contest(s) below:
Contest 1341:练习
Contest 1249:期末测试