http://acm.pku.edu.cn/JudgeOnline/problem?id=1224

http://acm.pku.edu.cn/JudgeOnline/images/1224_1.jpg