input: from typing import List
  
  def max_revenue(weights: List[int], values: List[int]) -> int:
      """ Calculate the maximum possible revenue from the items with given weights and values.
      >>> max_revenue([2, 1, 3], [4, 2, 3])
      7
      >>> max_revenue([10, 20, 30], [60, 100, 120])
      220
      """
output:     n = len(weights)
      dp = [0] * (n + 1)
      
      for i in range(n):
          for j in range(i, -1, -1):
              if dp[j] + values[i] > dp[j + 1]:
                  dp[j + 1] = dp[j] + values[i]
      
      return max(dp)