Created
June 2, 2021 09:12
-
-
Save Kernelzero/db45dbe7252057b9509cd07d2a074962 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 토핑수 | |
# 도우가격, 토핑가격 | |
# 도우의 칼로리 | |
# 토핑의 칼로리 | |
# 최고의 피자 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