Union Maplestory
Time limit1sMemory limit1024 MB
Given each character's level, sum the levels of the top 42 characters by level and the stat gains from reaching levels 60, 100, 140, 200, and 250.
- Level
Easy2 of 10
- Topics
- Sorting, Implementation
- Solved
- No attempts yet
Problem
Maplestory has a system called Union, and each level raises a character's stats. For a regular character, the stats go up by at levels , , , , and .
Sort the characters by level from highest to lowest. The Union raid party is made of the first characters in that order. If the number of characters is less than , every character joins the Union raid party.
You are given , the number of characters Ims owns, and the level of each character. Print the sum of the levels of the characters in Ims's raid party and the sum of the stat increases they gained.
Input
The first line contains , the number of characters Ims owns.
From the second line onward, each of the next lines contains one character's level .
Output
Print the sum of the levels and the sum of the stat increases for the characters in Ims's raid party, separated by a space.