

'''simple docstring'''

def 					__UpperCamelCase				(						lowercase__    :	list[int]			):






     '''simple docstring'''





     __lowercase      		=[]
     if len(lowercase__			) == 1:
          return [nums.copy()]
     for _ in range(len(lowercase__			)			):
          __lowercase      		=nums.pop(0			)
          __lowercase      		=permute(lowercase__			)
          for perm in permutations:
               perm.append(lowercase__			)
          result.extend(lowercase__			)
          nums.append(lowercase__			)
     return result

def 					__UpperCamelCase				(						lowercase__    :	Optional[Any]			):






     '''simple docstring'''





     def backtrack(lowercase__    :	str			):
          if start == len(lowercase__			) - 1:
               output.append(nums[:]			)
          else:
               for i in range(lowercase__,       len(lowercase__			)			):
                    __lowercase		,  __lowercase      		=nums[i], nums[start]
                    backtrack(start + 1			)
                    __lowercase		,  __lowercase      		=nums[i], nums[start]  # backtrack

     __lowercase      		=[]
     backtrack(0			)
     return output


if __name__ == "__main__":
       import doctest

       # use res to print the data in permute2 function
       UpperCAmelCase					 =	permutea([1, 2, 3])
       print(res)
       doctest.testmod()





'''simple docstring'''

from collections import defaultdict
from math import gcd

def 					__UpperCamelCase				(						lowercase__    :	int = 1_50_00_00			):






     '''simple docstring'''





     __lowercase      		=defaultdict(lowercase__			)
     __lowercase      		=2
     while 2 * euclid_m * (euclid_m + 1) <= limit:
          for euclid_n in range((euclid_m % 2) + 1,       lowercase__,       2			):
               if gcd(lowercase__,       lowercase__			) > 1:
                    continue
               __lowercase      		=2 * euclid_m * (euclid_m + euclid_n)
               for perimeter in range(lowercase__,       limit + 1,       lowercase__			):
                    frequencies[perimeter] += 1
          euclid_m += 1
     return sum(1 for frequency in frequencies.values() if frequency == 1			)


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


