def calculateItemCosts(itemCounts):
    itemPrices = getItemPrices()
    itemPrices.update(getGroupItemPrices())
    totalCost = 0
    for (item, count) in itemCounts.items():
        prices = itemPrices[item]
        for n in reversed(list(prices.keys())):
            if (n == 0):
                continue
            price = prices[n]
            offerCount = int((count / n))
            totalCost += (offerCount * price)
            count -= (offerCount * n)
    return totalCost
def calculateItemCosts(itemCounts):
    itemPrices = getItemPrices()
    itemPrices.update(getGroupItemPrices())
    totalCost = 0
    for (item, count) in itemCounts.items():
        prices = itemPrices[item]
        for n in reversed(list(prices.keys())):
            if (n == 0):
                continue
            price = prices[n]
            offerCount = int((count / n))
            totalCost += (offerCount * price)
            count -= (offerCount * n)
    return totalCost