Given an amount and receipts (name, desired_amount), distribute the amount across the recipients using the following criteria:
Divide the amount equally whenever possible. If it cannot be divided equally, give the extra units first to recipients whose names come first alphabetically. No recipient may receive more than their desired amount.
The function receives an integer amount and a list of (name, desired_amount) pairs. Return a dictionary mapping each name to its allocated integer amount. Assume names are unique and amount does not exceed the sum of all desired amounts.
Example 1: amount = 33, receipts = [("a", 10), ("b", 10), ("c", 10), ("d", 10)] returns {"a": 9, "b": 8, "c": 8, "d": 8}.
Example 2: amount = 10, receipts = [("amy", 2), ("bob", 10), ("cara", 10)] returns {"amy": 2, "bob": 4, "cara": 4}.
def distribute_amount(amount, receipts):