Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def sol(dep, n):
- commission = 0
- for i in range(n - 1):
- first_min = min(dep)
- dep.remove(first_min)
- second_min = min(dep)
- dep.remove(second_min)
- new_dep = first_min + second_min
- commission += new_dep * 0.05
- dep.append(new_dep)
- return commission
- n = int(input())
- deposit = [int(i) for i in input().split()]
- print(sol(deposit, n))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement