input: 
  from typing import List
  
  def max_revenue(weights: List[int], values: List[int], capacity: int) -> int:
      """ Calculate the maximum possible revenue from the items with given weights and values,
      given a total capacity of the knapsack.
      >>> max_revenue([2, 1, 3], [4, 2, 3], 5)
      7
      >>> max_revenue([1, 2, 4, 2, 5], [5, 3, 5, 3, 2], 10)
      16
      """
  
output:     dp = [0] * (capacity + 1)
      for i in range(len(weights)):
          for w in range(capacity, weights[i] - 1, -1):
              dp[w] = max(dp[w], dp[w - weights[i]] + values[i])
      return dp[capacity]