import bisect

def no_of_subsequences(arr, k):
    """
    Finds the number of subsequences of arr having a product smaller than k.
    The array arr contains non-negative integers.
    """
    if k <= 0:
        return 0

    pos_arr = [x for x in arr if x > 0]
    count_zeros = len(arr) - len(pos_arr)
    n_pos = len(pos_arr)

    def get_products(sub_array):
        """
        Generates all subsequence products for a given sub_array that are less than k.
        """
        products = [1]
        for x in sub_array:
            new_products = []
            for p in products:
                new_p = p * x
                if new_p < k:
                    new_products.append(new_p)
            products.extend(new_products)
        return products

    # Use a meet-in-the-middle approach for the array of positive numbers.
    # Split the array into two halves and find all subsequence products for each.
    mid = n_pos // 2
    first_half_products = get_products(pos_arr[:mid])
    second_half_products = get_products(pos_arr[mid:])
    
    second_half_products.sort()

    # Count valid subsequences formed only from positive numbers.
    # A valid subsequence is formed by combining a subsequence from the first half
    # and one from the second half, such that their product is less than k.
    count_pos_only = 0
    for p1 in first_half_products:
        # We need p1 * p2 < k, which means p2 < k / p1.
        # Using integer arithmetic, this is p2 <= (k - 1) // p1.
        limit = (k - 1) // p1
        # bisect_right finds the count of elements in second_half_products <= limit.
        count_pos_only += bisect.bisect_right(second_half_products, limit)

    # Subsequences can be partitioned into those with zeros and those without.
    # `count_pos_only` is the number of valid subsequences without any zeros.

    # Now, consider subsequences that include at least one zero.
    # The product of such a subsequence is 0. Since k > 0, all are valid.
    # A subsequence with at least one zero is formed by taking any subsequence
    # from the positive part (2^n_pos choices) and any non-empty subsequence
    # from the zero part (2^count_zeros - 1 choices).
    num_subsequences_with_zeros = (1 << n_pos) * ((1 << count_zeros) - 1)

    # The total count is the sum of counts from these two disjoint sets of subsequences.
    total_count = count_pos_only + num_subsequences_with_zeros
    
    return total_count