


from doctest import testmod
from math import sqrt







def 	A (		A__			):
     UpperCAmelCase    :					list[int]			=      []
     if num < 1:
          return facs
     facs.append(1			)
     if num == 1:
          return facs
     facs.append(A__			)
     for i in range(2		,		int(sqrt(A__			)			) + 1			):
          if num % i == 0:  # If i is a factor of num
               facs.append(A__			)
               UpperCAmelCase    :					Tuple			=      num // i  # num//i is the other factor of num
               if d != i:  # If d and i are distinct
                    facs.append(A__			)  # we have found another factor
     facs.sort()
     return facs


if __name__ == "__main__":
      testmod(name="factors_of_a_number", verbose=True)







from __future__ import annotations







def 	A (		A__		,		A__		,		A__		,		A__			):

     # 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:
          UpperCAmelCase    :					List[str]			=      capacity - weights[counter - 1]
          UpperCAmelCase    :					Tuple			=      values[counter - 1] + knapsack(
              A__		,		A__		,		A__		,		counter - 1			)
          UpperCAmelCase    :					Optional[int]			=      knapsack(A__		,		A__		,		A__		,		counter - 1			)
          return max(A__		,		A__			)


if __name__ == "__main__":
      import doctest

      doctest.testmod()



