To the Max http://poj.org/problem?id=1050