def max_sum(nums: list[int]) -> int:
    # your move