
    Design an early intervention system that analyzes a student's academic performance pattern to identify the strongest possible upward trajectory until a specific assessment period, while also considering a future checkpoint score. The system should examine the sequence of increasing assessment scores up to the current evaluation period and include a selected future checkpoint score in its analysis. The goal is to find the maximum sum of scores that represents the best possible academic improvement path, helping educators identify optimal intervention timing. The analysis must maintain the chronological order of assessments and only consider sequences where scores are consistently improving.
    

    
def max_sum_increasing_subseq(a, n, index, k):
    """
    Design an early intervention system that analyzes a student's academic performance pattern to identify the strongest possible upward trajectory until a specific assessment period, while also considering a future checkpoint score. The system should examine the sequence of increasing assessment scores up to the current evaluation period and include a selected future checkpoint score in its analysis. The goal is to find the maximum sum of scores that represents the best possible academic improvement path, helping educators identify optimal intervention timing. The analysis must maintain the chronological order of assessments and only consider sequences where scores are consistently improving.
    

    """
def max_sum_increasing_subseq(a, n, index, k):
    """
    Design an early intervention system that analyzes a student's academic performance pattern to identify the strongest possible upward trajectory until a specific assessment period, while also considering a future checkpoint score. The system should examine the sequence of increasing assessment scores up to the current evaluation period and include a selected future checkpoint score in its analysis. The goal is to find the maximum sum of scores that represents the best possible academic improvement path, helping educators identify optimal intervention timing. The analysis must maintain the chronological order of assessments and only consider sequences where scores are consistently improving.
    

    """
    dp = [[0 for i in range(n)] for i in range(n)]
    for i in range(n):
        if a[i] > a[0]:
            dp[0][i] = a[i] + a[0]
        else:
            dp[0][i] = a[i]
    for i in range(1, n):
        for j in range(n):
            if a[j] > a[i] and j > i:
                if dp[i - 1][i] + a[j] > dp[i - 1][j]:
                    dp[i][j] = dp[i - 1][i] + a[j]
                else:
                    dp[i][j] = dp[i - 1][j]
            else:
                dp[i][j] = dp[i - 1][j]
    return dp[index][k]