input: Write a function to calculate the maximum possible revenue from the items with given weights and values. If the total capacity of the knapsack is W=5, the function should return the maximum value that can be obtained. This function should include the weights and values of the items and the number of items. 
  assert knapsack([2, 1, 3], [4, 2, 3], 3) == 5
  assert knapsack([3, 4, 5], [10, 11, 15], 3) == 26
  assert knapsack([1, 2, 3], [1, 4, 6], 3) == 7
  assert knapsack([1, 1, 1], [1, 2, 3], 3) == 5
  assert knapsack([], [], 0) == 0
output: def knapsack(weights, values, n):
      dp = [0] * (W + 1)
      for i in range(n):
          for w in range(W, weights[i] - 1, -1):
              dp[w] = max(dp[w], dp[w - weights[i]] + values[i])
      return dp[W]