This problem is in Contest(s) below:
Contest 1097:Java上机练习 软件工程24 #3