#K81572. Product Except First Minimum
Product Except First Minimum
Product Except First Minimum
Given an array of n integers, your task is to compute the product of all elements except the first occurrence of the smallest element. Formally, let \(a_1, a_2, \dots, a_n\) be the elements of the array and let \(a_j = \min\{a_1, a_2, \dots, a_n\}\) be the first occurrence of the minimum value. You need to calculate
$$P = \prod_{\substack{1 \le i \le n \\ i \neq j}} a_i $$If the array contains only one element, simply output that element.
inputFormat
The first line contains a single integer n (1 ≤ n ≤ 105), denoting the number of elements in the array. The second line contains n space-separated integers, representing the elements of the array.
outputFormat
Output a single integer, which is the product of all elements except the first occurrence of the smallest element in the array.
## sample1
1
1