This problem is in Contest(s) below:
Contest 1159:GESP二级考试编程第二题汇总
Contest 1172:GESP二级考试编程第二题汇总