http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=2136 http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=22218