poj 3264 Balanced Lineup (rmq st)