This problem is in Contest(s) below:
Contest 6205:AK 张老师 语法中级D班 双重循环应用 及时间问题
Contest 6195:Ak张老师语法中级C班 双重枚举及时间问题家庭作业