
'''simple docstring'''




from math import pi, sqrt







def 						lowerCAmelCase_							(  snake_case__		):




    '''simple docstring'''



    if num <= 0:
        raise ValueError('''math domain error'''		)
    if num > 1_71.5:
        raise OverflowError('''math range error'''		)
    elif num - int(snake_case__		) not in (0, 0.5):
        raise NotImplementedError('''num must be an integer or a half-integer'''		)
    elif num == 0.5:
        return sqrt(snake_case__		)
    else:
        return 1.0 if num == 1 else (num - 1) * gamma(num - 1		)







def 						lowerCAmelCase_							(  ):




    '''simple docstring'''



    assert gamma(0.5		) == sqrt(snake_case__		)
    assert gamma(1		) == 1.0
    assert gamma(2		) == 1.0


if __name__ == "__main__":
      from doctest import testmod

      testmod()
      lowercase     :							List[str]       						=     1.0
      while num:
            lowercase     :							List[Any]       						=     float(input('Gamma of: '))
            print(f'''gamma({num}) = {gamma(num)}''')
            print('\nEnter 0 to exit...')






'''simple docstring'''




def 						lowerCAmelCase_							(  snake_case__		):




    '''simple docstring'''



    if len(snake_case__		) <= 1:
        return [tuple(snake_case__		)]

    A			:  int   =		[]

    def generate(snake_case__						,							snake_case__		):
        if k == 1:
            res.append(tuple(arr[:]		)		)
            return

        generate(k - 1						,							snake_case__		)

        for i in range(k - 1		):
            if k % 2 == 0:  # k is even
                A,    A			:  Any   =		arr[k - 1], arr[i]
            else:  # k is odd
                A,    A			:  List[str]   =		arr[k - 1], arr[0]
            generate(k - 1						,							snake_case__		)

    generate(len(snake_case__		)						,							snake_case__		)
    return res


if __name__ == "__main__":
      lowercase     :							int       						=     input('Enter numbers separated by a comma:\n').strip()
      lowercase     :							Dict       						=     [int(item) for item in user_input.split(',')]
      print(heaps(arr))




