dp rod-cut