



'''simple docstring'''



from __future__ import annotations


def 							__UpperCAmelCase				(				UpperCamelCase__				:list   ,				UpperCamelCase__				:list			)		->						list:
				snake_case__      :   List[Any]      =    [None] * (len(UpperCamelCase__			) + len(UpperCamelCase__			))

				snake_case__      :   Optional[int]      =    0  # pointer to current index for left Half
				snake_case__      :   Union[str, Any]      =    0  # pointer to current index for the right Half
				snake_case__      :   Optional[int]      =    0  # pointer to current index for the sorted array Half

				while pointera < len(UpperCamelCase__			) and pointera < len(UpperCamelCase__			):
								if left_half[pointera] < right_half[pointera]:
												snake_case__      :   List[str]      =    left_half[pointera]
												pointera += 1
												index += 1
								else:
												snake_case__      :   List[Any]      =    right_half[pointera]
												pointera += 1
												index += 1
				while pointera < len(UpperCamelCase__			):
								snake_case__      :   List[str]      =    left_half[pointera]
								pointera += 1
								index += 1

				while pointera < len(UpperCamelCase__			):
								snake_case__      :   List[Any]      =    right_half[pointera]
								pointera += 1
								index += 1

				return sorted_array


def 							__UpperCAmelCase				(				UpperCamelCase__				:list			)		->						list:
				if len(UpperCamelCase__			) <= 1:
								return array
				# the actual formula to calculate the middle element = left + (right - left) // 2
				# this avoids integer overflow in case of large N
				snake_case__      :   int      =    0 + (len(UpperCamelCase__			) - 0) // 2

				# Split the array into halves till the array length becomes equal to One
				# merge the arrays of single length returned by mergeSort function and
				# pass them into the merge arrays function which merges the array
				snake_case__      :   List[Any]      =    array[:middle]
				snake_case__      :   Union[str, Any]      =    array[middle:]

				return merge(merge_sort(UpperCamelCase__			)   ,				merge_sort(UpperCamelCase__			)			)


if __name__ == "__main__":
				import doctest

				doctest.testmod()












"""simple docstring"""


from doctest import testmod
from math import sqrt




def      snake_case    (A_ :int ):







  '''simple docstring'''

  a	:     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_ )
      a	:     Optional[Any]							=  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)




