Skip to content

Commit

Permalink
Create Cost_Cutting.py
Browse files Browse the repository at this point in the history
  • Loading branch information
TaurusSilver201 authored Mar 16, 2024
1 parent 8255a17 commit d190623
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Cost_Cutting.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cases = int(input())
for _ in range(cases):
arr = list(map(int, input().split()))
n, x, y = arr[0], arr[1], arr[2]
salaries = arr[3:]
salaries.sort(reverse=True)
total_cost = sum(salaries)
for i in range(x):
total_cost -= salaries[i]
for i in range(x, x+y):
total_cost -= salaries[i] // 3
print(total_cost)

0 comments on commit d190623

Please sign in to comment.