"""simple docstring"""


from math import asin, atan, cos, radians, sin, sqrt, tan

UpperCAmelCase__  		=						637_8137.0
UpperCAmelCase__  		=						635_6752.31_4245
UpperCAmelCase__  		=						6_3_7_8_1_3_7






def     __UpperCAmelCase					(			lowercase   ,lowercase   ,lowercase   ,lowercase		):







  """simple docstring"""
  _UpperCAmelCase						 =      (AXIS_A - AXIS_B) / AXIS_A
  _UpperCAmelCase						 =      atan((1 - flattening) * tan(radians(lowercase		)		)		)
  _UpperCAmelCase						 =      atan((1 - flattening) * tan(radians(lowercase		)		)		)
  _UpperCAmelCase						 =      radians(lowercase		)
  _UpperCAmelCase						 =      radians(lowercase		)
  # Equation
  _UpperCAmelCase						 =      sin((phi_a - phi_a) / 2		)
  _UpperCAmelCase						 =      sin((lambda_a - lambda_a) / 2		)
  # Square both values
  sin_sq_phi *= sin_sq_phi
  sin_sq_lambda *= sin_sq_lambda
  _UpperCAmelCase						 =      sqrt(sin_sq_phi + (cos(lowercase		) * cos(lowercase		) * sin_sq_lambda)		)
  return 2 * RADIUS * asin(lowercase		)


if __name__ == "__main__":
    import doctest

    doctest.testmod()

"""simple docstring"""


from __future__ import annotations

from random import choice






def     __UpperCAmelCase					(			lowercase		):







  """simple docstring"""
  return choice(lowercase		)






def     __UpperCAmelCase					(			lowercase   ,lowercase		):







  """simple docstring"""
  _UpperCAmelCase						 =      random_pivot(lowercase		)

  # partition based on pivot
  # linear time
  _UpperCAmelCase						 =      [e for e in lst if e < pivot]
  _UpperCAmelCase						 =      [e for e in lst if e > pivot]

  # if we get lucky, pivot might be the element we want.
  # we can easily see this:
  # small (elements smaller than k)
  # + pivot (kth element)
  # + big (elements larger than k)
  if len(lowercase		) == k - 1:
    return pivot
  # pivot is in elements bigger than k
  elif len(lowercase		) < k - 1:
    return kth_number(lowercase   ,k - len(lowercase		) - 1		)
  # pivot is in elements smaller than k
  else:
    return kth_number(lowercase   ,lowercase		)


if __name__ == "__main__":
    import doctest

    doctest.testmod()
