

'''simple docstring'''

from __future__ import annotations

import math

import numpy as np
from numpy.linalg import norm





def    A_  ( snake_case      ,       snake_case ):
  return math.sqrt(sum(pow(a - b      ,       2 ) for a, b in zip(snake_case      ,       snake_case ) ) )





def    A_  ( snake_case      ,       snake_case ):

  if dataset.ndim != value_array.ndim:
    SCREAMING_SNAKE_CASE:List[str]						      =					(
        "Wrong input data's dimensions... "
        F'''dataset : {dataset.ndim}, value_array : {value_array.ndim}'''
    )
    raise ValueError(snake_case )

  try:
    if dataset.shape[1] != value_array.shape[1]:
      SCREAMING_SNAKE_CASE:int						      =					(
          "Wrong input data's shape... "
          F'''dataset : {dataset.shape[1]}, value_array : {value_array.shape[1]}'''
      )
      raise ValueError(snake_case )
  except IndexError:
    if dataset.ndim != value_array.ndim:
      raise TypeError("Wrong shape" )

  if dataset.dtype != value_array.dtype:
    SCREAMING_SNAKE_CASE:Union[str, Any]						      =					(
        "Input data have different datatype... "
        F'''dataset : {dataset.dtype}, value_array : {value_array.dtype}'''
    )
    raise TypeError(snake_case )

  SCREAMING_SNAKE_CASE:Union[str, Any]						      =					[]

  for value in value_array:
    SCREAMING_SNAKE_CASE:List[Any]						      =					euclidean(snake_case      ,       dataset[0] )
    SCREAMING_SNAKE_CASE:Optional[Any]						      =					dataset[0].tolist()

    for dataset_value in dataset[1:]:
      SCREAMING_SNAKE_CASE:List[str]						      =					euclidean(snake_case      ,       snake_case )

      if dist > temp_dist:
        SCREAMING_SNAKE_CASE:Any						      =					temp_dist
        SCREAMING_SNAKE_CASE:str						      =					dataset_value.tolist()

    answer.append([vector, dist] )

  return answer





def    A_  ( snake_case      ,       snake_case ):
  return np.dot(snake_case      ,       snake_case ) / (norm(snake_case ) * norm(snake_case ))


if __name__ == "__main__":
    import doctest

    doctest.testmod()



'''simple docstring'''

def    A_  ( snake_case ):
  SCREAMING_SNAKE_CASE:Dict						      =					(1 + 24 * n) ** 0.5
  return ((1 + root) / 6) % 1 == 0





def    A_  ( snake_case = 5000 ):
  SCREAMING_SNAKE_CASE:int						      =					[(i * (3 * i - 1)) // 2 for i in range(1      ,       snake_case )]
  for i, pentagonal_i in enumerate(snake_case ):
    for j in range(snake_case      ,       len(snake_case ) ):
      SCREAMING_SNAKE_CASE:int						      =					pentagonal_nums[j]
      SCREAMING_SNAKE_CASE:Any						      =					pentagonal_i + pentagonal_j
      SCREAMING_SNAKE_CASE:int						      =					pentagonal_j - pentagonal_i
      if is_pentagonal(snake_case ) and is_pentagonal(snake_case ):
        return b

  return -1


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






