Question:
Mr. Myers and the Exam
A mathematics question paper has a certain number of questions, and each question is assigned some random maximum marks. Mr. Myers wants to edit the marks assigned to the questions such that:
1. All questions in the paper should have distinct maximum marks.
2. The total marks of all the questions should be as low as possible.
Mr. Myers wants to achieve this by making minimal changes in the original format, assigning each question at least as many marks as it originally had. Find the minimum total marks that he can set the paper for.
Input Specification:
input1: The number of questions in the paper
input2: The array representing the original marks assigned to every question
Output Specification:
The minimum total marks Mr. Myers can set the paper for.
Example 1:
input1: 5
input2: (1, 2, 3, 4, 5)