def price(order):
    base_price = order['quantity'] * order['item_price']
    quantity_discount = max(0, order['quantity'] - 500) * order['item_price'] * 0.05
    shipping = min(base_price * 0.1, 100)
    return base_price - quantity_discount + shipping


if __name__ == '__main__':
    print(price({
        'quantity': 10,
        'item_price': 1000,
    }))
