


"""simple docstring"""




from collections.abc import Sequence

def        lowercase							(		lowerCAmelCase__ :     Sequence[int] | None = None			) ->      int:
		if nums is None or not nums:
				raise ValueError('''Input sequence should not be empty'''			)

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

		return ans


if __name__ == "__main__":
				import doctest

				doctest.testmod()

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










"""simple docstring"""




def        lowercase							(		lowerCAmelCase__ :     list			) ->      bool:
		if not isinstance(lowerCAmelCase__    ,					lowerCAmelCase__			):
				raise ValueError('''Input series is not valid, valid series - [2, 4, 6]'''			)
		if len(lowerCAmelCase__			) == 0:
				raise ValueError('''Input list must be a non empty list'''			)
		if len(lowerCAmelCase__			) == 1:
				return True
		__a           =			series[1] - series[0]
		for index in range(len(lowerCAmelCase__			) - 1			):
				if series[index + 1] - series[index] != common_diff:
						return False
		return True

def        lowercase							(		lowerCAmelCase__ :     list			) ->      float:
		if not isinstance(lowerCAmelCase__    ,					lowerCAmelCase__			):
				raise ValueError('''Input series is not valid, valid series - [2, 4, 6]'''			)
		if len(lowerCAmelCase__			) == 0:
				raise ValueError('''Input list must be a non empty list'''			)
		__a           =			0
		for val in series:
				answer += val
		return answer / len(lowerCAmelCase__			)


if __name__ == "__main__":
				import doctest

				doctest.testmod()






