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.
      >>> max_revenue([2, 1, 3], [4, 2, 3], 5)
      7
      >>> max_revenue([1, 2, 3], [1, 4, 6], 7)
      8
      """
  
output:     dp = [0] * (capacity + 1)
      for w, v in zip(weights, values):
          for j in range(capacity, w - 1, -1):
              dp[j] = max(dp[j], dp[j - w] + v)
      return dp[capacity]