Skip to content

Instantly share code, notes, and snippets.

@cocodrips cocodrips/
Last active Dec 31, 2015

What would you like to do?
SRM600 Div2 Easy
class TheShuttles:
def getLeastCost(self, cnt, baseCost, seatCost):
cnt = list(cnt)
m = max(cnt)
mini = 100000000000
for i in xrange(1, m + 1):
sum = 0
for c in cnt:
sum += (baseCost + (seatCost * i)) * math.ceil(float(c) / i)
mini = min(mini, sum)
return mini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.