input: Write a function to calculate the maximum possible revenue from items with given weights and values using the knapsack algorithm. The function should take in two lists, weights and values, representing the weights and values of the items respectively, and return the maximum revenue that can be achieved with a knapsack of capacity 5. If the input lists are empty, the function should return 0.
  assert knapsack([2, 1, 3], [4, 2, 3], 3) == 6
  assert knapsack([1, 2, 3], [6, 10, 12], 3) == 22
  assert knapsack([3, 4, 5], [2, 3, 4], 3) == 7
  assert knapsack([], [], 0) == 0
  assert knapsack([1, 2], [5, 6], 2) == 11
output: def knapsack(weights, values, n):
      if n == 0:
          return 0
      dp = [0] * 6
      for i in range(n):
          for w in range(5, weights[i] - 1, -1):
              dp[w] = max(dp[w], dp[w - weights[i]] + values[i])
      return dp[5]