input: Write a function to divide a list into two subsets such that the difference of their sums is minimized.
  assert divide_list([1, 2, 3, 4, 5]) in [([1, 4, 5], [2, 3]), ([2, 3], [1, 4, 5])]
  assert divide_list([10, 20, 15, 5, 25]) in [([10, 25], [20, 15, 5]), ([20, 15, 5], [10, 25])]
  assert divide_list([1, 6, 11, 5]) in [([1, 6, 5], [11]), ([11], [1, 6, 5])]
output: def divide_list(nums):
      total_sum = sum(nums)
      n = len(nums)
      dp = [[False] * (total_sum // 2 + 1) for _ in range(n + 1)]
      dp[0][0] = True
      
      for i in range(1, n + 1):
          for j in range(total_sum // 2 + 1):
              if dp[i-1][j]:
                  dp[i][j] = True
              if j >= nums[i-1] and dp[i-1][j-nums[i-1]]:
                  dp[i][j] = True
      
      for j in range(total_sum // 2, -1, -1):
          if dp[n][j]:
              subset1_sum = j
              break
      
      subset1 = []
      subset2 = nums.copy()
      i, j = n, subset1_sum
      while i > 0 and j > 0:
          if not dp[i-1][j]:
              subset1.append(nums[i-1])
              subset2.remove(nums[i-1])
              j -= nums[i-1]
          i -= 1
      
      return subset1, subset2