




'''simple docstring'''



from __future__ import annotations







def 	_UpperCamelCase       (_lowerCamelCase							:   int      ,		_lowerCamelCase							:   list[int]      ,		_lowerCamelCase							:   list[int]      ,		_lowerCamelCase							:   int		)->      int:




     '''simple docstring'''





     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(_lowerCamelCase      ,		_lowerCamelCase      ,		_lowerCamelCase      ,		counter - 1		)
     else:
          __snake_case			    =     capacity - weights[counter - 1]
          __snake_case			    =     values[counter - 1] + knapsack(
              _lowerCamelCase      ,		_lowerCamelCase      ,		_lowerCamelCase      ,		counter - 1		)
          __snake_case			    =     knapsack(_lowerCamelCase      ,		_lowerCamelCase      ,		_lowerCamelCase      ,		counter - 1		)
          return max(_lowerCamelCase      ,		_lowerCamelCase		)


if __name__ == "__main__":
     import doctest

     doctest.testmod()












'''simple docstring'''



from __future__ import annotations

import math
from itertools import permutations







def 	_UpperCamelCase       (_lowerCamelCase							:   int		)->      bool:




     '''simple docstring'''





     if 1 < number < 4:
          # 2 and 3 are primes
          return True
     elif number < 2 or number % 2 == 0 or number % 3 == 0:
          # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
          return False

     # All primes number are in format of 6k +/- 1
     for i in range(5      ,		int(math.sqrt(_lowerCamelCase		) + 1		)      ,		6		):
          if number % i == 0 or number % (i + 2) == 0:
               return False
     return True







def 	_UpperCamelCase       (_lowerCamelCase							:   int = 7		)->      int:




     '''simple docstring'''





     __snake_case			    =     ''''''.join(str(_lowerCamelCase		) for i in range(1      ,		n + 1		)		)
     __snake_case			    =     [int(''''''.join(_lowerCamelCase		)		) for i in permutations(_lowerCamelCase      ,		_lowerCamelCase		)]
     __snake_case			    =     [num for num in perm_list if is_prime(_lowerCamelCase		)]
     return max(_lowerCamelCase		) if pandigitals else 0


if __name__ == "__main__":
     print(F"""{solution() = }""")






