This problem is in Contest(s) below:
Contest 1756:基础模拟训练
Contest 1004:17lx寒假作业