#C10527. Maximum Gift Bags
Maximum Gift Bags
Maximum Gift Bags
You are given \( n \) types of candies and a list of integers representing the number of candies available for each type. Each gift bag must contain exactly one candy from each type. In other words, if you form a gift bag, you must pick one candy from each of the \( n \) types. Therefore, the maximum number of gift bags you can create is determined by the type with the fewest candies, which can be mathematically represented as \( \min\{c_1, c_2, \dots, c_n\} \).
Your task is to compute the maximum number of complete gift bags that can be prepared given the counts of each candy type.
inputFormat
The input consists of two lines:
- The first line contains an integer \( n \) — the number of candy types.
- The second line contains \( n \) space-separated integers \( c_1, c_2, \dots, c_n \), where \( c_i \) represents the number of candies available of the \( i\text{th} \) type.
outputFormat
Output a single integer — the maximum number of gift bags that can be prepared.
## sample3
6 3 9
3