Determine the Maximum Sum of Weights | CodeChef