input: from typing import List
  
  def knapsack(weights: List[int], values: List[int], n: int) -> int:
      """Calculate the maximum possible revenue from the items with given weights and values.
  
      >>> knapsack([2, 1, 3], [4, 2, 3], 3)
      7
      """
output:     dp = [0] * (n + 1)
      for w, v in zip(weights, values):
          for j in range(n, w - 1, -1):
              dp[j] = max(dp[j], dp[j - w] + v)
      return dp[n]