1969: [USACO 2022 December Contest Bronze] Problem 1. Cow College
题目描述
Farmer John is planning to open a new university for cows!
There are () cows who could potentially attend this university. Each cow is willing to pay a maximum tuition of (). Farmer John can set the tuition that all cows must pay to enroll. If this tuition is greater than the maximum a cow is willing to pay, then the cow will not attend the university. Farmer John wants to make the most possible money so he can pay his instructors a fair wage. Please determine how much money he can make, and how much tuition he should charge.
输入
输出
Note that the large size of integers involved in this problem may require the use of 64-bit integer data types (e.g., a "long" in Java, a "long long" in C/C++).
样例输入
4
1 6 4 6
样例输出
12 4
提示
If Farmer John charges , then cows will attend, allowing him to make .
SCORING:
- Test cases 2 through 4 have .
- Test cases 5 through 8 have .
- Test cases 9 through 12 have no additional constraints.