Binary search the answer
left = 1 NEW_LINE right = n NEW_LINE while ( right > left ) : NEW_LINE INDENT mid = ( left + right ) >> 1 NEW_LINE if ( isCover ( n , mid , m ) == False ) : NEW_LINE INDENT left = mid + 1 NEW_LINE DEDENT else : NEW_LINE INDENT right = mid NEW_LINE DEDENT DEDENT