


"""simple docstring"""






import numpy as np
from numpy import floataa
from numpy.typing import NDArray



def 			A__		(					_UpperCAmelCase    :      NDArray[floataa]				,    _UpperCAmelCase    :      NDArray[floataa]	)							->	NDArray[floataa]:

	'''simple docstring'''


	snake_case__,					snake_case__  :						Any		=      np.shape(_UpperCAmelCase	)

	snake_case__  :						NDArray[floataa]		=      np.zeros((rows, 1)				,    dtype=_UpperCAmelCase	)
	for row in reversed(range(_UpperCAmelCase	)	):
		snake_case__  :						Dict		=      0
		for col in range(row + 1				,    _UpperCAmelCase	):
			total += coefficients[row, col] * x[col]

		snake_case__  :						List[str]		=      (vector[row] - total) / coefficients[row, row]

	return x



def 			A__		(					_UpperCAmelCase    :      NDArray[floataa]				,    _UpperCAmelCase    :      NDArray[floataa]	)							->	NDArray[floataa]:

	'''simple docstring'''


	snake_case__,					snake_case__  :						str		=      np.shape(_UpperCAmelCase	)
	if rows != columns:
		return np.array(()				,    dtype=_UpperCAmelCase	)

	# augmented matrix
	snake_case__  :						NDArray[floataa]		=      np.concatenate((coefficients, vector)				,    axis=1	)
	snake_case__  :						List[Any]		=      augmented_mat.astype("float64"	)

	# scale the matrix leaving it triangular
	for row in range(rows - 1	):
		snake_case__  :						Any		=      augmented_mat[row, row]
		for col in range(row + 1				,    _UpperCAmelCase	):
			snake_case__  :						Optional[Any]		=      augmented_mat[col, row] / pivot
			augmented_mat[col, :] -= factor * augmented_mat[row, :]

	snake_case__  :						List[str]		=      retroactive_resolution(
	    augmented_mat[:, 0:columns]				,    augmented_mat[:, columns : columns + 1]	)

	return x


if __name__ == "__main__":
					import doctest

					doctest.testmod()









from __future__ import annotations

import math
from itertools import permutations

def 		snake_case_   (				lowercase__     :    int     ):






				'''simple docstring'''






				if 1 < number < 4:
								# 2 and 3 are primes
								return True
				elif number < 2 or number % 2 == 0 or number % 3 == 0:
								# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
								return False

				# All primes number are in format of 6k +/- 1
				for i in range(5       ,     int(math.sqrt(lowercase__     ) + 1     )       ,     6     ):
								if number % i == 0 or number % (i + 2) == 0:
												return False
				return True

def 		snake_case_   (				lowercase__     :    int = 7     ):






				'''simple docstring'''






				_lowerCAmelCase  						="""""".join(str(lowercase__     ) for i in range(1       ,     n + 1     )     )
				_lowerCAmelCase  						=[int("""""".join(lowercase__     )     ) for i in permutations(lowercase__       ,     lowercase__     )]
				_lowerCAmelCase  						=[num for num in perm_list if is_prime(lowercase__     )]
				return max(lowercase__     ) if pandigitals else 0


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

