Maximize the sum

Problem Name:
Maximize the sum
Site:HackerEarth
Links:
Tags:
Problem setters: