POJ 1180 Batch scheduling-DP optimized by monotonous queue