This problem is found in https://codeforces.com/problemset/problem/1326/C. I don\'t seem to get the summation notation with max function.
Here\'s an explanation of o