input: Write a function that takes a dictionary as an argument and returns an inverted dictionary where the values of the original dictionary become the keys of the new dictionary, and the keys of the original dictionary become the values of the new dictionary. If the original dictionary contains multiple keys with the same value, the inverted dictionary should group those keys into a list under the corresponding value in the inverted dictionary. If the input dictionary is empty, return an empty dictionary.
  
  assert invert_dictionary({'a': 1, 'b': 2, 'c': 3}) == {1: ['a'], 2: ['b'], 3: ['c']}
  assert invert_dictionary({'a': 1, 'b': 2, 'c': 1}) == {1: ['a', 'c'], 2: ['b']}
  assert invert_dictionary({'a': 'apple', 'b': 'banana', 'c': 'cherry'}) == {'apple': ['a'], 'banana': ['b'], 'cherry': ['c']}
  assert invert_dictionary({'x': 10, 'y': 10, 'z': 20}) == {10: ['x', 'y'], 20: ['z']}
  assert invert_dictionary({}) == {}
output: def invert_dictionary(d):
      inverted = {}
      for key, value in d.items():
          if value in inverted:
              inverted[value].append(key)
          else:
              inverted[value] = [key]
      return inverted