






def    a__    (	A       ):
   # base case
   if len(A       ) == 1:
      return a[0], a[0]
   else:
      # split A into half.
      lowercase__    :						Optional[Any]       =			a[: len(A       ) // 2]
      lowercase__    :						List[str]       =			a[len(A       ) // 2 :]

      # 2 sub problems, 1/2 of original size.
      lowercase__  ,       lowercase__    :						int       =			max_difference(A       )
      lowercase__  ,       lowercase__    :						List[str]       =			max_difference(A       )

      # get min of first and max of second
      # linear time
      lowercase__    :						Dict       =			min(A       )
      lowercase__    :						Tuple       =			max(A       )

      # 3 cases, either (small1, big1),
      # (min_first, max_second), (small2, big2)
      # constant comparisons
      if biga - smalla > max_second - min_first and biga - smalla > biga - smalla:
         return smalla, biga
      elif biga - smalla > max_second - min_first:
         return smalla, biga
      else:
         return min_first, max_second


if __name__ == "__main__":
 import doctest

 doctest.testmod()










from datetime import date

import requests

a 			=							'https://api.carbonintensity.org.uk/intensity'
def    a__    (	):
   lowercase__    :						Union[str, Any]       =			requests.get(A       ).json()["""data"""][0]
   return last_half_hour["intensity"]["actual"]
def    a__    (	A		,					A       ):
   return requests.get(F'''{BASE_URL}/{start}/{end}'''       ).json()["data"]


if __name__ == "__main__":
 for entry in fetch_from_to(start=date(2020, 10, 1), end=date(2020, 10, 3)):
  print('from {from} to {to}: {intensity[actual]}'.format(**entry))
 print(F'{fetch_last_half_hour() = }')


