Function to check if a number is a perfect Cube or not
function isPerfectCube ( x ) { var cr = Math . round ( Math . cbrt ( x ) ) ; return ( cr * cr * cr == x ) ; } function canBePerfectCube ( N , K ) { if ( isPerfectCube ( N + K ) || isPerfectCube ( N - K ) ) document . write ( " " ) ; else document . write ( " " ) ; }