Function to return the count of divisors of elem
function divisorcount ( elem ) { let ans = 0 ; for ( let i = 1 ; i <= Math . sqrt ( elem ) ; i ++ ) { if ( elem % i == 0 ) { if ( i * i == elem ) ans ++ ; else ans += 2 ; } } return ans ; }