
'''simple docstring'''

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







def __A  (    lowerCAmelCase_ ,       lowerCAmelCase_       ):
     _UpperCAmelCase  ,     _UpperCAmelCase					:  Tuple         =    np.shape(lowerCAmelCase_       )

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

          _UpperCAmelCase					:  Dict         =    (vector[row] - total) / coefficients[row, row]

     return x







def __A  (    lowerCAmelCase_ ,       lowerCAmelCase_       ):
     _UpperCAmelCase  ,     _UpperCAmelCase					:  Any         =    np.shape(lowerCAmelCase_       )
     if rows != columns:
          return np.array(() ,       dtype=lowerCAmelCase_       )

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

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

     _UpperCAmelCase					:  Dict         =    retroactive_resolution(
         augmented_mat[:, 0:columns] ,       augmented_mat[:, columns : columns + 1]       )

     return x


if __name__ == "__main__":
   import doctest

   doctest.testmod()




'''simple docstring'''

from itertools import permutations







def __A  (    ):
     _UpperCAmelCase					:  Union[str, Any]         =    list(map("""""".join ,       permutations("""0123456789"""       )       )       )
     return result[99_9999]


if __name__ == "__main__":
   print(solution())


