You are given a dictionary orders keyed by order id (string). Each value is a record {'price': int | float, 'quantities': list[int]}, where price is the unit price and quantities is a list of quantities purchased in that order.
Return a new dictionary mapping each order id to its total value, defined as price * sum(quantities). The returned dictionary must be built in ascending order of order id. An order with an empty quantities list contributes a total of 0. If orders is empty, return an empty dictionary.
NOTE: This is a function-type question — you only write the function. Do not read input or print anything; a hidden checker calls your function and checks its return value.
Arguments
{'o1': {'price': 2, 'quantities': [1, 2, 3]}, 'o2': {'price': 5, 'quantities': [2]}}
Returns
{'o1': 12, 'o2': 10}