

from __future__ import annotations

import math
import random





def 	snake_case_      (__A     :						int					,   __A     :						int					,   __A     :						int     )			->	list[int]:
   __lowerCAmelCase  :			Dict					    =						d * e - 1
   __lowerCAmelCase  :			Optional[Any]					    =						0
   __lowerCAmelCase  :			int					    =						0
   while p == 0:
      __lowerCAmelCase  :			Dict					    =						random.randint(2					,   n - 1     )
      __lowerCAmelCase  :			int					    =						k
      while True:
         if t % 2 == 0:
            __lowerCAmelCase  :			int					    =						t // 2
            __lowerCAmelCase  :			Dict					    =						(g**t) % n
            __lowerCAmelCase  :			Union[str, Any]					    =						math.gcd(x - 1					,   __A     )
            if x > 1 and y > 1:
               __lowerCAmelCase  :			List[str]					    =						y
               __lowerCAmelCase  :			List[str]					    =						n // y
               break  # find the correct factors
         else:
            break  # t is not divisible by 2, break and choose another g
   return sorted([p, q]     )


if __name__ == "__main__":
   import doctest

   doctest.testmod()





from __future__ import annotations

SCREAMING_SNAKE_CASE_						=					'Alexander Joslin'

def 							__SCREAMING_SNAKE_CASE							( lowerCAmelCase:     int       )      ->				int:

				if number <= 0:
								_UpperCAmelCase				:						Optional[Any]       						=			F'n must be greater than 0. Got n = {number}'
								raise ValueError(lowerCAmelCase       )

				_UpperCAmelCase				:						Dict       						=			[number + 1] * (number + 1)

				# starting position
				_UpperCAmelCase				:						Dict       						=			0
				for i in range(1     ,					lowerCAmelCase       ):
								_UpperCAmelCase				:						int       						=			min(table[i + 1]     ,					table[i] + 1       )
								# check if out of bounds
								if i * 2 <= number:
												_UpperCAmelCase				:						int       						=			min(table[i * 2]     ,					table[i] + 1       )
								# check if out of bounds
								if i * 3 <= number:
												_UpperCAmelCase				:						int       						=			min(table[i * 3]     ,					table[i] + 1       )
				return table[number]


if __name__ == "__main__":
					import doctest

					doctest.testmod()


