you give array a_1 a_2 dot a_n consist n integer you give integer value xLet fk maximum sum contiguous subarray apply follow operation add x element exactly k distinct position an subarray consider sum 0Note subarray do not include increase elementsCalculate maximum value fk k 0 n independently