Untitled
unknown
python
a year ago
482 B
7
Indexable
# 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)
Editor is loading...