The Flood Season Harvest
View as PDF
Submit solution
Points:
5
Time limit:
2.0s
Memory limit:
64M
Authors:
Problem type
Allowed languages
C, C++, Java, Pascal, Perl, Python, Sed, Text
The Flood Season Harvest
After the Nile floods recede, farmers measure their grain harvest in baskets. The vizier needs the total grain and the floor of the average per farm for the Pharaoh's official records.
Your Task
Given integers (grain counts), output the total sum and the floor of the
average (integer division:
/
).
Input Specification
The first line contains an integer — the number of reports.
Each report starts with
on its own line, followed by
space-separated integers.
Output Specification
For each report print two lines:
Total: <>
Average: <floor()>
Sample Input
2
4
10 20 30 40
3
7 8 9
Sample Output
Total: 100
Average: 25
Total: 24
Average: 8
Constraints
Comments
a
This one is honestly harder than the second one.
That is true , especially for c++ programmers