If this element is the second element in the individual pair , the find gcd with the previous element and add to the answer and recur for the next element
else : NEW_LINE INDENT ans = max ( ans , __gcd ( a [ last ] , a [ i ] ) + recur ( i + 1 , cnt + 1 , 0 , a , n , k , dp ) ) NEW_LINE DEDENT dp [ ind ] [ cnt ] = ans NEW_LINE return ans NEW_LINE