Generate a pair of integers from a range [ L , R ] whose LCM also lies within the range | javascript implementation of the above approach ; Checking if any pair is possible or not in range ( l , r ) ; If not possible print ( - 1 ) ; Prvar LCM pair ; Driver code ; Function call
function lcmpair ( l , r ) { var x , y ; x = l ; y = 2 * l ; if ( y > r ) { document . write ( " " ) ; } else { document . write ( " " + x + " " + y + " " ) ; } } var l = 13 , r = 69 ; lcmpair ( l , r ) ;