94. Total Payroll
Foundation1000 ms256 MBSolved by 0%
Read n employee records, each holding an employee id and a monthly salary.
Print the total of all salaries, then the highest single salary, separated by a space.
Constraints - `1 ≤ n ≤ 100000` - `1 ≤ id ≤ 1000000` - `0 ≤ salary ≤ 10000000`
Input
The first line contains an integer n.
Each of the next n lines contains an employee id and a monthly salary.
Output
Print two integers on one line, separated by a single space, the total of all salaries, then the highest salary.
Input3
1 50000
2 75000
3 60000
Output185000 75000
Noteis a small payroll
Input1
7 42000
Output42000 42000
Notehas one employee, so the total and the maximum are the same
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.
Hint 1Where to start
Hint 2The approachOpen hint 1 first. This one carries on from it.
Hint 3PseudocodeOpen hint 2 first. This one carries on from it.
Hint 4Full solutionOpen hint 3 first. This one carries on from it.