




'''simple docstring'''


import numpy as np



def    _SCREAMING_SNAKE_CASE    (			UpperCamelCase__						:				Any							):




     """simple docstring"""


     a_	,    a_    :       Any    	=     a.shape
     a_    :       Optional[Any]    	=     min(UpperCamelCase__   ,						UpperCamelCase__							)
     a_    :       List[Any]    	=     np.eye(UpperCamelCase__							)
     a_    :       Dict    	=     a.copy()

     for k in range(t - 1							):
          # select a column of modified matrix A':
          a_    :       str    	=     r[k:, [k]]
          # construct first basis vector
          a_    :       Optional[Any]    	=     np.zeros_like(UpperCamelCase__							)
          a_    :       Dict    	=     1.0
          # determine scaling factor
          a_    :       Any    	=     np.linalg.norm(UpperCamelCase__							)
          # construct vector v for Householder reflection
          a_    :       List[Any]    	=     x + np.sign(x[0]							) * alpha * ea
          v /= np.linalg.norm(UpperCamelCase__							)

          # construct the Householder matrix
          a_    :       Optional[int]    	=     np.eye(m - k							) - 2.0 * v @ v.T
          # pad with ones and zeros as necessary
          a_    :       Optional[Any]    	=     np.block([[np.eye(UpperCamelCase__							), np.zeros((k, m - k)							)], [np.zeros((m - k, k)							), q_k]]							)

          a_    :       Optional[Any]    	=     q @ q_k.T
          a_    :       Any    	=     q_k @ r

     return q, r


if __name__ == "__main__":
 import doctest

 doctest.testmod()






'''simple docstring'''


def    _SCREAMING_SNAKE_CASE    (			UpperCamelCase__						:				int = 1000							):




     """simple docstring"""


     return sum(i for i in range(UpperCamelCase__							) if i % 3 == 0 or i % 5 == 0							)


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