Generate a pair of integers from a range [ L , R ] whose LCM also lies within the range | Python3 implementation of the above approach ; Checking if any pair is possible or not in range ( l , r ) ; If not possible print ( - 1 ) ; Print LCM pair ; Driver Code ; Function call
def lcmpair ( l , r ) : NEW_LINE INDENT x = l NEW_LINE y = 2 * l NEW_LINE if ( y > r ) : NEW_LINE INDENT print ( - 1 ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " X ▁ = ▁ { } ▁ Y ▁ = ▁ { } " . format ( x , y ) ) NEW_LINE DEDENT DEDENT l = 13 NEW_LINE r = 69 NEW_LINE lcmpair ( l , r ) NEW_LINE