This problem is in Contest(s) below:
Contest 1890:计算机202第二学期第9次上机实验-竞赛练习
Contest 1232:2017级暑期集训练习赛