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 ans = max ( ans , __gcd ( a [ last ] , a [ i ] ) + recur ( i + 1 , cnt + 1 , 0 , a , n , k , dp ) ) ; } return dp [ ind ] [ cnt ] = ans ; }