This problem is in Contest(s) below:
Contest 1038:暑期集训高级班第8课作业
Contest 1049:2010秋高级班第11课作业
Contest 1112:2012.9长训班第5课练习
Contest 1871:19暑假8
Contest 1321:2017.3C长训班2第9课作业
Contest 1452:201709C++中级第8作业
Contest 1466:寒假玩编码