


'''simple docstring'''

def __snake_case      (   UpperCAmelCase_		:		int = 100	):
 lowerCamelCase_  				=						n * (n + 1) * (2 * n + 1) / 6
 lowerCamelCase_  				=						(n * (n + 1) / 2) ** 2
 return int(square_of_sum - sum_of_squares	)


if __name__ == "__main__":
     print(f'''{solution() = }''')







'''simple docstring'''

from collections.abc import Sequence





def __snake_case      (   UpperCAmelCase_		:		Sequence[int] | None = None	):
 if nums is None or not nums:
  raise ValueError("Input sequence should not be empty"	)

 lowerCamelCase_  				=						nums[0]
 for i in range(1      ,       len(UpperCAmelCase_	)	):
  lowerCamelCase_  				=						nums[i]
  lowerCamelCase_  				=						max(UpperCAmelCase_      ,       ans + num      ,       UpperCAmelCase_	)

 return ans


if __name__ == "__main__":
     import doctest

     doctest.testmod()

     # Try on a sample input from the user
     a_						:       Any      			=				int(input("""Enter number of elements : """).strip())
     a_						:       Union[str, Any]      			=				list(map(int, input("""\nEnter the numbers : """).strip().split()))[:n]
     print(max_subsequence_sum(array))



