DP min pth sum done