def max_sum_increasing_subseq(a, n, index, k):
	
	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]
def max_sum_increasing_subseq(a, n, index, k):
    dp = [[0 for VAR_0 in range(n)] for VAR_0 in range(n)]
    for VAR_0 in range(n):
        if a[VAR_0] > a[0]:
            dp[0][VAR_0] = a[VAR_0] + a[0]
        else:
            dp[0][VAR_0] = a[VAR_0]
    for VAR_0 in range(1, n):
       
        for j in range(n):
            if a[j] > a[VAR_0] and j > VAR_0:
                if dp[VAR_0 - 1][VAR_0] + a[j] > dp[VAR_0 - 1][j]:
                    dp[VAR_0][j] = dp[VAR_0 - 1][VAR_0] + a[j]
                else:
                    dp[VAR_0][j] = dp[VAR_0 - 1][j]
            else:
                dp[VAR_0][j] = dp[VAR_0 - 1][j]
    return dp[index][k]