#K12881. Gift Bag Distribution
Gift Bag Distribution
Gift Bag Distribution
You are given an integer \( n \) representing the number of types of items, and a list of \( n \) integers. Each integer represents the number of available items of that type. Your task is to distribute all items evenly into \( n \) gift bags such that each gift bag contains the maximum possible number of items, and all gift bags have an equal count.
Let \( S = \sum_{i=1}^{n} a_i \) be the total number of items. Then the maximum number of items each bag can have is \( \lfloor\frac{S}{n}\rfloor \). Since we need to form exactly \( n \) bags, the answer will be a pair \( (\lfloor\frac{S}{n}\rfloor, n) \).
Input will be provided via standard input and output should be written to standard output.
inputFormat
The first line of input contains an integer \( n \) indicating the number of item types. The second line contains \( n \) space-separated integers, where the \( i\)-th integer represents the number of available items of the \( i\)-th type.
outputFormat
Output two space-separated integers: the first is the maximum number of items per gift bag, and the second is the number of gift bags (which is equal to \( n \)).
## sample1
5
5 1