
    Given a student's sequential performance scores across n different learning activities, and knowing they need to repeat this learning sequence k times to achieve mastery, determine the highest cumulative performance streak possible across their entire learning journey. The performance streak must consist of consecutive scores, and can span across repeated sequences of the learning activities.
    

    
def max_sub_array_sum_repeated(a, n, k):
    """
    Given a student's sequential performance scores across n different learning activities, and knowing they need to repeat this learning sequence k times to achieve mastery, determine the highest cumulative performance streak possible across their entire learning journey. The performance streak must consist of consecutive scores, and can span across repeated sequences of the learning activities.
    

    """
def max_sub_array_sum_repeated(a, n, k):
    """
    Given a student's sequential performance scores across n different learning activities, and knowing they need to repeat this learning sequence k times to achieve mastery, determine the highest cumulative performance streak possible across their entire learning journey. The performance streak must consist of consecutive scores, and can span across repeated sequences of the learning activities.
    

    """
    max_so_far = -2147483648
    max_ending_here = 0
    for i in range(n * k):
        max_ending_here = max_ending_here + a[i % n]
        if max_so_far < max_ending_here:
            max_so_far = max_ending_here
        if max_ending_here < 0:
            max_ending_here = 0
    return max_so_far