input: Write a function to optimize any given code using an AI-powered Python script. The function should be able to handle the example code provided, which involves a function that returns the sum of three numbers, and it should optimize this function by iterating over a range of values for the parameters and finding the best combination that maximizes the result. The function should return the optimized parameters in a dictionary format.
  
  assert optimize((lambda p: p.a + p.b + p.c), Params(a=1, b=2, c=3))=={'a': 11, 'b': 12, 'c': 13}
  assert optimize((lambda p: p.a + p.b + p.c), Params(a=0, b=0, c=0))=={'a': 10, 'b': 10, 'c': 10}
  assert optimize((lambda p: p.a - p.b - p.c), Params(a=2, b=2, c=2))=={'a': 12, 'b': -8, 'c': -8}
  assert optimize((lambda p: p.a * p.b * p.c), Params(a=1, b=1, c=1))=={'a': 11, 'b': 11, 'c': 11}
  assert optimize((lambda p: p.a + p.b), Params(a=5, b=5, c=0))=={'a': 15, 'b': 15, 'c': 0}
output: def optimize(func, params):
      best_params = {}
      best_result = float('-inf')
      for a in range(params.a, 20):
          for b in range(params.b, 20):
              for c in range(params.c, 20):
                  result = func(Params(a=a, b=b, c=c))
                  if result > best_result:
                      best_result = result
                      best_params = {'a': a, 'b': b, 'c': c}
      return best_params