Skip to content

Commit

Permalink
떡볶이 떡 만들기 (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
ezidayzi committed Mar 6, 2022
1 parent db853dd commit bc6d49e
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
n, m = map(int, input().split())
items = list(map(int, input().split()))

items.sort()

end = items[n-1]

while end >= 0:
sum = 0
for item in items:
if item - end > 0:
sum += item - end

if sum >= m:
break
end -= 1

print(end)

0 comments on commit bc6d49e

Please sign in to comment.