This problem is in Contest(s) below:
Contest 1028:2018萌新作业12-循环嵌套
Contest 1040:pyex萌新作业12-循环嵌套
Contest 1057:18萌新作业12-循环嵌套