input: Write a python function to find the value of x in the range 0 to n that maximizes the function f(x).
  assert optimize(f, 5) == 5
  assert optimize(f, 10) == 10
  assert optimize(f, 0) == 0
output: def optimize(f, n):
      max_value = float('-inf')
      max_x = 0
      for x in range(n + 1):
          current_value = f(x)
          if current_value > max_value:
              max_value = current_value
              max_x = x
      return max_x