input: Write a function to calculate the maximum possible revenue from the items with given weights and values. The function should take in two lists, one for weights and one for values, and return the maximum revenue that can be achieved given a fixed knapsack capacity.
  assert knapsack([2, 1, 3], [4, 2, 3], 3) == 7
  assert knapsack([1, 2, 3], [6, 10, 12], 3) == 22
  assert knapsack([1, 2, 4], [10, 20, 30], 3) == 36
  assert knapsack([1, 1, 1], [5, 5, 5], 3) == 15
  assert knapsack([], [], 0) == 0
output: def knapsack(weights, values, capacity):
      n = len(weights)
      dp = [0] * (capacity + 1)
      
      for i in range(n):
          for w in range(capacity, weights[i] - 1, -1):
              dp[w] = max(dp[w], dp[w - weights[i]] + values[i])
      
      return dp[capacity]