input: Write a python function to solve the 0/1 knapsack problem.
  assert knapsack(50, [60, 100, 120], [10, 20, 30]) == 220
  assert knapsack(10, [10, 20, 30], [1, 2, 3]) == 60
  assert knapsack(7, [10, 20, 30], [1, 2, 3]) == 50
output: def knapsack(max_weight, values, weights):
      n = len(values)
      dp = [[0 for _ in range(max_weight + 1)] for _ in range(n + 1)]
      
      for i in range(n + 1):
          for w in range(max_weight + 1):
              if i == 0 or w == 0:
                  dp[i][w] = 0
              elif weights[i-1] <= w:
                  dp[i][w] = max(values[i-1] + dp[i-1][w-weights[i-1]], dp[i-1][w])
              else:
                  dp[i][w] = dp[i-1][w]
      
      return dp[n][max_weight]