adding DP and divide and conquer