Contest
Time limit1sMemory limit128 MB
Given 20 scores, split into two groups of 10, output each group's sum of its top 3 scores.
- Level
Easy2 of 10
- Topics
- Sorting, Implementation
- Solved
- No attempts yet
Problem
An online programming contest was held. The computer clubs of W University and K University have long been rivals, so they decided to settle their rivalry through this contest.
This time, 10 students from each of the two universities took part. After a long discussion, they decided that each university's score would be the sum of the scores of its top 3 participants among the 10.
Given the scores of the participants from W University and K University, write a program that computes each university's score.
Input
The input consists of 20 lines. Lines 1 through 10 give the score of each participant from W University, and lines 11 through 20 give the score of each participant from K University, one integer per line. Every score is an integer between 0 and 100, inclusive.
Output
Print W University's score and K University's score on one line, in that order, separated by a single space.