#K37697. Maximum Full Strap Orders

    ID: 26034 Type: Default 1000ms 256MiB

Maximum Full Strap Orders

Maximum Full Strap Orders

In this problem, you are given an inventory of straps in different colors. A full strap order requires exactly one strap from each color. Given the number of available colors and the inventory (i.e., the number of straps available for each color), your task is to determine the maximum number of full strap orders that can be fulfilled.

More formally, if there are (n) colors and the inventory is given by (a_1, a_2, \dots, a_n), then the maximum full orders is: [ orders = \min_{1 \le i \le n} a_i ]

This problem tests your ability to compute a simple minimum across a list of integers and properly handle input and output for competitive programming.

inputFormat

The input is read from standard input (stdin). The first line contains an integer (n), representing the number of different available colors. The second line contains (n) space-separated integers, where the (i)-th integer represents the number of straps available of the (i)-th color.

outputFormat

Output a single integer on standard output (stdout), representing the maximum number of complete strap orders. Since one complete order requires one strap from each color, the answer is the minimum count among all colors, i.e., (\min_{1 \le i \le n} a_i).## sample

3
5 9 7
5