# https://leetcode.com/problems/maximum-sum-with-exactly-k-elements/ 

class Solution(object):
	def maximizeSum(self, nums, k):
		return k * max(nums) + k * (k - 1) // 2

class Solution(object):
	def maximizeSum(self, nums, k):
		m = max(nums)
		res = 0
		for _ in range(k):
			res += m
			m += 1
		return res

a62db5deb67c4045dfb51af1ace2eb49133df8e4
<mask token>


class Solution(object):
    <mask token>

<mask token>


class Solution(object):

    def maximizeSum(self, nums, k):
        m = max(nums)
        res = 0
        for _ in range(k):
            res += m
            m += 1
        return res

class Solution(object):
    <mask token>


class Solution(object):

    def maximizeSum(self, nums, k):
        m = max(nums)
        res = 0
        for _ in range(k):
            res += m
            m += 1
        return res

class Solution(object):

    def maximizeSum(self, nums, k):
        return k * max(nums) + k * (k - 1) // 2


class Solution(object):

    def maximizeSum(self, nums, k):
        m = max(nums)
        res = 0
        for _ in range(k):
            res += m
            m += 1
        return res

# https://leetcode.com/problems/maximum-sum-with-exactly-k-elements/ 

class Solution(object):
	def maximizeSum(self, nums, k):
		return k * max(nums) + k * (k - 1) // 2

class Solution(object):
	def maximizeSum(self, nums, k):
		m = max(nums)
		res = 0
		for _ in range(k):
			res += m
			m += 1
		return res
