input: Write a function to divide a given list of numbers into two equal parts such that the difference between the sum of the two parts is minimized. If the input list has an odd number of elements, the two parts will not have equal size but should still aim to minimize the sum difference. The function should return two lists representing the two parts.
  def divide_in_two_equal_parts(lst):
      if not lst:
          return [], []
      target = sum(lst) // 2
      dp = [False] * (target + 1)
      dp[0] = True
      for num in lst:
          for i in range(target, num - 1, -1):
              if dp[i - num]:
                  dp[i] = True
      part1_sum = target
      while not dp[part1_sum]:
          part1_sum -= 1
      part1 = []
      part2 = lst[:]
      for num in reversed(lst):
          if part1_sum >= num and dp[part1_sum - num]:
              part1.append(num)
              part2.remove(num)
              part1_sum -= num
      return part1, part2
  
  assert divide_in_two_equal_parts([2, 3, 4, 5, 6, 7])==([4, 3, 7], [6, 5, 2])
  assert divide_in_two_equal_parts([1, 2, 3, 4, 5])==([1, 4, 2], [5, 3])
  assert divide_in_two_equal_parts([10, 20, 30, 40])==([40, 10], [30, 20])
  assert divide_in_two_equal_parts([10, 20, 30, 40, 50])==([20, 50, 10], [40, 30])
  assert divide_in_two_equal_parts([])==([], [])
output: def divide_in_two_equal_parts(lst):
      if not lst:
          return [], []
      target = sum(lst) // 2
      dp = [False] * (target + 1)
      dp[0] = True
      for num in lst:
          for i in range(target, num - 1, -1):
              if dp[i - num]:
                  dp[i] = True
      part1_sum = target
      while not dp[part1_sum]:
          part1_sum -= 1
      part1 = []
      part2 = lst[:]
      for num in reversed(lst):
          if part1_sum >= num and dp[part1_sum - num]:
              part1.append(num)
              part2.remove(num)
              part1_sum -= num
      return part1, part2