Untitled

mail@pastecode.io avatar
unknown
python
7 months ago
482 B
3
Indexable
Never
# Read the number of employees
N = int(input().strip())

# Read the list of employee donations and convert them to integers
donations = list(map(int, input().strip().split()))

# Read the value of M
M = int(input().strip())

# Sort the list of donations
donations.sort()

# Multiply the first M smallest donations
company_contribution = 1
for i in range(M):
    company_contribution *= donations[i]

# Print the company's contribution
print(company_contribution)