input: 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
      >>> knapsack([1, 2, 3], [6, 10, 12], 3)
      22
      """
output:     dp = [0] * (n + 1)
      for i in range(len(weights)):
          for j in range(n, weights[i] - 1, -1):
              dp[j] = max(dp[j], dp[j - weights[i]] + values[i])
      return dp[n]