input: Write a python function to invert a dictionary with lists as values.
  assert invert_dict({'a': [1, 4], 'b': [2], 'c': [3]}) == {1: 'a', 4: 'a', 2: 'b', 3: 'c'}
  assert invert_dict({'x': [5, 7], 'y': [8], 'z': [9, 6]}) == {5: 'x', 7: 'x', 8: 'y', 9: 'z', 6: 'z'}
  assert invert_dict({'key1': [10, 20], 'key2': [30], 'key3': [40, 50]}) == {10: 'key1', 20: 'key1', 30: 'key2', 40: 'key3', 50: 'key3'}
output: def invert_dict(d):
      inverted = {}
      for key, values in d.items():
          for value in values:
              inverted[value] = key
      return inverted