This problem is in Contest(s) below:
Contest 1384:【算法设计与分析】实验一
Contest 1393:【算法设计与分析】实验1 算法优化技巧与时间复杂度
Contest 1519:算法实验1