This problem is in Contest(s) below:
Contest 1384:【算法设计与分析】实验一
Contest 1519:算法实验1