
    Given a sequence of traffic flow measurements representing vehicles per minute passing through an intersection at different times, find the highest traffic impact value calculated by multiplying the vehicle counts from any increasing sequence of measurements. This calculation helps identify the most critical periods requiring traffic signal optimization by capturing the compound effect of progressively increasing traffic volumes.
    

    
def max_product(arr):
    """
    Given a sequence of traffic flow measurements representing vehicles per minute passing through an intersection at different times, find the highest traffic impact value calculated by multiplying the vehicle counts from any increasing sequence of measurements. This calculation helps identify the most critical periods requiring traffic signal optimization by capturing the compound effect of progressively increasing traffic volumes.
    

    """
def max_product(arr):
    """
    Given a sequence of traffic flow measurements representing vehicles per minute passing through an intersection at different times, find the highest traffic impact value calculated by multiplying the vehicle counts from any increasing sequence of measurements. This calculation helps identify the most critical periods requiring traffic signal optimization by capturing the compound effect of progressively increasing traffic volumes.
    

    """
    n = len(arr)
    mpis = arr[:]
    for i in range(n):
        current_prod = arr[i]
        j = i + 1
        while j < n:
            if arr[j - 1] > arr[j]:
                break
            current_prod *= arr[j]
            if current_prod > mpis[j]:
                mpis[j] = current_prod
            j = j + 1
    return max(mpis)