
    Given a sequence of sensor readings from vehicle components over time, determine the highest risk factor by multiplying the values from a subset of readings that show progressively worsening conditions (where each selected reading is higher than the previous one). This calculation helps identify the most critical maintenance scenarios based on deteriorating component performance patterns.
    

    
def max_product(arr):
    """
    Given a sequence of sensor readings from vehicle components over time, determine the highest risk factor by multiplying the values from a subset of readings that show progressively worsening conditions (where each selected reading is higher than the previous one). This calculation helps identify the most critical maintenance scenarios based on deteriorating component performance patterns.
    

    """
def max_product(arr):
    """
    Given a sequence of sensor readings from vehicle components over time, determine the highest risk factor by multiplying the values from a subset of readings that show progressively worsening conditions (where each selected reading is higher than the previous one). This calculation helps identify the most critical maintenance scenarios based on deteriorating component performance patterns.
    

    """
    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)