This problem is in Contest(s) below:
Contest 1278:ACM训练题 二(大二)
Contest 1008:RoboCup3D招新测试