

def        __UpperCamelCase     (      _A					:							int		)				->int:



							"""simple docstring"""
							if not isinstance(_A      ,  _A		):
														raise TypeError("""recursive_lucas_number accepts only integer arguments."""		)
							if n_th_number == 0:
														return 2
							if n_th_number == 1:
														return 1

							return recursive_lucas_number(n_th_number - 1		) + recursive_lucas_number(
							    n_th_number - 2		)




def        __UpperCamelCase     (      _A					:							int		)				->int:



							"""simple docstring"""
							if not isinstance(_A      ,  _A		):
														raise TypeError("""dynamic_lucas_number accepts only integer arguments."""		)
							lowerCamelCase_	,   lowerCamelCase_								=2, 1
							for _ in range(_A		):
														lowerCamelCase_	,   lowerCamelCase_								=b, a + b
							return a


if __name__ == "__main__":
	from doctest import testmod

	testmod()
	__A	:   Any	=					int(input('Enter the number of terms in lucas series:\n').strip())
	print('Using recursive function to calculate lucas series:')
	print(' '.join(str(recursive_lucas_number(i)) for i in range(n)))
	print('\nUsing dynamic function to calculate lucas series:')
	print(' '.join(str(dynamic_lucas_number(i)) for i in range(n)))



from __future__ import annotations




def        __UpperCamelCase     (      _A					:							int      ,  _A					:							list[int]      ,  _A					:							list[int]      ,  _A					:							int		)				->int:



							"""simple docstring"""

							# Base Case
							if counter == 0 or capacity == 0:
														return 0

							# If weight of the nth item is more than Knapsack of capacity,
							#   then this item cannot be included in the optimal solution,
							# else return the maximum of two cases:
							#   (1) nth item included
							#   (2) not included
							if weights[counter - 1] > capacity:
														return knapsack(_A      ,  _A      ,  _A      ,  counter - 1		)
							else:
														lowerCamelCase_								=capacity - weights[counter - 1]
														lowerCamelCase_								=values[counter - 1] + knapsack(
														    _A      ,  _A      ,  _A      ,  counter - 1		)
														lowerCamelCase_								=knapsack(_A      ,  _A      ,  _A      ,  counter - 1		)
														return max(_A      ,  _A		)


if __name__ == "__main__":
	import doctest

	doctest.testmod()
