
    Given a student's historical performance data where each value represents a composite score of attendance, test results, and class participation, find the highest possible impact score calculated by multiplying scores from periods of consistent improvement. The impact score must be derived from a sequence where each selected score is higher than all previous selected scores, representing sustained academic progress over time.
    

    
def max_product(arr):
    """
    Given a student's historical performance data where each value represents a composite score of attendance, test results, and class participation, find the highest possible impact score calculated by multiplying scores from periods of consistent improvement. The impact score must be derived from a sequence where each selected score is higher than all previous selected scores, representing sustained academic progress over time.
    

    """
def max_product(arr):
    """
    Given a student's historical performance data where each value represents a composite score of attendance, test results, and class participation, find the highest possible impact score calculated by multiplying scores from periods of consistent improvement. The impact score must be derived from a sequence where each selected score is higher than all previous selected scores, representing sustained academic progress over time.
    

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