Function to check if the person can do all jobs in H hours with speed K
function isPossible ( A , n , H , K ) { var time = 0 ; for ( var i = 0 ; i < n ; ++ i ) time += parseInt ( ( A [ i ] - 1 ) / K ) + 1 ; return time <= H ; }