





import numpy as np

import datasets


lowercase_          =		"""
Compute the Mahalanobis Distance

Mahalonobis distance is the distance between a point and a distribution.
And not between two distinct points. It is effectively a multivariate equivalent of the Euclidean distance.
It was introduced by Prof. P. C. Mahalanobis in 1936
and has been used in various statistical applications ever since
[source: https://www.machinelearningplus.com/statistics/mahalanobis-distance/]
"""

lowercase_          =		"""\
@article{de2000mahalanobis,
  title={The mahalanobis distance},
  author={De Maesschalck, Roy and Jouan-Rimbaud, Delphine and Massart, D{\'e}sir{\'e} L},
  journal={Chemometrics and intelligent laboratory systems},
  volume={50},
  number={1},
  pages={1--18},
  year={2000},
  publisher={Elsevier}
}
"""

lowercase_          =		"""
Args:
    X: List of datapoints to be compared with the `reference_distribution`.
    reference_distribution: List of datapoints from the reference distribution we want to compare to.
Returns:
    mahalanobis: The Mahalonobis distance for each datapoint in `X`.
Examples:

    >>> mahalanobis_metric = datasets.load_metric(\"mahalanobis\")
    >>> results = mahalanobis_metric.compute(reference_distribution=[[0, 1], [1, 0]], X=[[0, 1]])
    >>> print(results)
    {'mahalanobis': array([0.5])}
"""
@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION      ,     _KWARGS_DESCRIPTION				)
class     SCREAMING_SNAKE_CASE       (datasets.Metric				):


   def 	SCREAMING_SNAKE_CASE_							(   self      :    List[Any]	)->       int:





     """simple docstring"""







     return datasets.MetricInfo(
         description=_DESCRIPTION      ,					citation=_CITATION      ,					inputs_description=_KWARGS_DESCRIPTION      ,					features=datasets.Features(
             {
                 'X': datasets.Sequence(datasets.Value('float'      ,					id='sequence'	)      ,					id='X'	),
             }	)      ,					)


   def 	SCREAMING_SNAKE_CASE_							(   self      :    Optional[Any]      ,					a      :    Tuple      ,					a      :    Optional[Any]	)->       List[str]:





     """simple docstring"""







     lowercase__           =  np.array(a	)
     lowercase__           =  np.array(a	)

     # Assert that arrays are 2D
     if len(X.shape	) != 2:
       raise ValueError('Expected `X` to be a 2D vector'	)
     if len(reference_distribution.shape	) != 2:
       raise ValueError('Expected `reference_distribution` to be a 2D vector'	)
     if reference_distribution.shape[0] < 2:
       raise ValueError(
           'Expected `reference_distribution` to be a 2D vector with more than one element in the first dimension'	)

     # Get mahalanobis distance for each prediction
     lowercase__           =  X - np.mean(a	)
     lowercase__           =  np.cov(reference_distribution.T	)
     try:
       lowercase__           =  np.linalg.inv(a	)
     except np.linalg.LinAlgError:
       lowercase__           =  np.linalg.pinv(a	)
     lowercase__           =  np.dot(a      ,					a	)
     lowercase__           =  np.dot(a      ,					X_minus_mu.T	).diagonal()

     return {"mahalanobis": mahal_dist}









import sys

lowercase_          =		(
    """73167176531330624919225119674426574742355349194934"""
    """96983520312774506326239578318016984801869478851843"""
    """85861560789112949495459501737958331952853208805511"""
    """12540698747158523863050715693290963295227443043557"""
    """66896648950445244523161731856403098711121722383113"""
    """62229893423380308135336276614282806444486645238749"""
    """30358907296290491560440772390713810515859307960866"""
    """70172427121883998797908792274921901699720888093776"""
    """65727333001053367881220235421809751254540594752243"""
    """52584907711670556013604839586446706324415722155397"""
    """53697817977846174064955149290862569321978468622482"""
    """83972241375657056057490261407972968652414535100474"""
    """82166370484403199890008895243450658541227588666881"""
    """16427171479924442928230863465674813919123162824586"""
    """17866458359124566529476545682848912883142607690042"""
    """24219022671055626321111109370544217506941658960408"""
    """07198403850962455444362981230987879927244284909188"""
    """84580156166097919133875499200524063689912560717606"""
    """05886116467109405077541002256983155200055935729725"""
    """71636269561882670428252483600823257530420752963450"""
)




def       __UpperCamelCase  (_SCREAMING_SNAKE_CASE = N		)    ->       int:
  lowercase__           =  -sys.maxsize - 1
  for i in range(len(_SCREAMING_SNAKE_CASE		) - 12		):
    lowercase__           =  1
    for j in range(13		):
      product *= int(n[i + j]		)
    if product > largest_product:
      lowercase__           =  product
  return largest_product


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


