Skip to content

Instantly share code, notes, and snippets.

@Kernelzero
Created June 2, 2021 09:12
Show Gist options
  • Save Kernelzero/db45dbe7252057b9509cd07d2a074962 to your computer and use it in GitHub Desktop.
Save Kernelzero/db45dbe7252057b9509cd07d2a074962 to your computer and use it in GitHub Desktop.
# 토핑수
# 도우가격, 토핑가격
# 도우의 칼로리
# 토핑의 칼로리
# 최고의 피자 1달러당 칼로리
toppingCount = int(input())
doughCost, toppingCost = map(int, input().split())
doughCal = int(input())
toppingCals = list()
for i in range(toppingCount):
toppingCals.append(int(input()))
toppingCals.sort(reverse=True)
pizzaPrice = doughCost
pizzaCal = doughCal
bestPizza = doughCal / float(doughCost)
for n in toppingCals:
pizzaCal += n
pizzaPrice += toppingCost
result = pizzaCal / float(pizzaPrice)
# print('%f, %f' %(result, bestPizza))
if result > bestPizza:
bestPizza = result
print(int(bestPizza))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment