Function to find the maximum element
def getMax ( arr , n , k ) : NEW_LINE INDENT res = 0 NEW_LINE for i in range ( 1 , n ) : NEW_LINE INDENT if ( arr [ i ] % k == 0 ) : NEW_LINE INDENT res = max ( res , arr [ i ] ) NEW_LINE DEDENT DEDENT return res NEW_LINE DEDENT