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

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