input: def quad_fib(n: int):
      """The QuadFib sequence is a variant of the Fibonacci sequence and is defined as follows:
      quad_fib(0) -> 0
      quad_fib(1) -> 0
      quad_fib(2) -> 2
      quad_fib(3) -> 0
      quad_fib(n) -> quad_fib(n-1) + quad_fib(n-2) + quad_fib(n-3) + quad_fib(n-4).
      Please develop a function to calculate the n-th term of the QuadFib sequence efficiently. Avoid using recursion.
      >>> quad_fib(5)
      4
      >>> quad_fib(6)
      8
      >>> quad_fib(7)
      14
      """
output:     
      if n == 0:
          return 0
      elif n == 1:
          return 0
      elif n == 2:
          return 2
      elif n == 3:
          return 0
      
      quad_fib_seq = [0, 0, 2, 0]
      
      for i in range(4, n + 1):
          next_value = quad_fib_seq[-1] + quad_fib_seq[-2] + quad_fib_seq[-3] + quad_fib_seq[-4]
          quad_fib_seq.append(next_value)
      
      return quad_fib_seq[n]
  