Find two distinct numbers such that their LCM lies in given range | Function to find two distinct numbers X and Y s . t . their LCM lies between L and R and X , Y are minimum possible ; Check if 2 * L lies in range L , R ; Print the answer ; Given value of ranges ; Function call
function answer ( L , R ) { if ( 2 * L <= R ) document . write ( L + " " + 2 * L + " " ) ; else document . write ( - 1 ) ; } let L = 3 , R = 8 ; answer ( L , R ) ;